From b20359f51a1c3be5603be9908061b27f883f9467 Mon Sep 17 00:00:00 2001 From: Josh Allmann Date: Sun, 29 Aug 2010 10:25:16 +0000 Subject: rtsp: Return AVERROR_EOF when all streams have received an RTCP BYE packet Patch by Josh Allmann, joshua dot allmann at gmail Originally committed as revision 24965 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/rtpdec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libavformat/rtpdec.c') diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index 25fe5a7..debc14c 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -92,11 +92,13 @@ static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int l buf += payload_len; len -= payload_len; break; + case RTCP_BYE: + return -RTCP_BYE; default: return -1; } } - return 0; + return -1; } #define RTP_SEQ_MOD (1<<16) @@ -451,8 +453,7 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt, if ((buf[0] & 0xc0) != (RTP_VERSION << 6)) return -1; if (buf[1] >= RTCP_SR && buf[1] <= RTCP_APP) { - rtcp_parse_packet(s, buf, len); - return -1; + return rtcp_parse_packet(s, buf, len); } payload_type = buf[1] & 0x7f; if (buf[1] & 0x80) -- cgit v1.1