]> git.sesse.net Git - ffmpeg/commitdiff
rtpdec: Don't call the depacketizer to return more data unless it actually said it...
authorMartin Storsjö <martin@martin.st>
Wed, 13 Oct 2010 08:13:07 +0000 (08:13 +0000)
committerMartin Storsjö <martin@martin.st>
Wed, 13 Oct 2010 08:13:07 +0000 (08:13 +0000)
It may have returned a negative number for an error (e.g. AVERROR(EAGAIN),
if more data is required for it to be able to return a complete packet).

Originally committed as revision 25458 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/rtpdec.c

index 51583c081a219ac0b0148591423402a33bff0e62..240229abfd10a741af36c00a4c9629831aaa2b3a 100644 (file)
@@ -613,10 +613,10 @@ static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt,
     int rv= 0;
 
     if (!buf) {
-        /* If parsing of the previous packet actually returned 0, there's
-         * nothing more to be parsed from that packet, but we may have
+        /* If parsing of the previous packet actually returned 0 or an error,
+         * there's nothing more to be parsed from that packet, but we may have
          * indicated that we can return the next enqueued packet. */
-        if (!s->prev_ret)
+        if (s->prev_ret <= 0)
             return rtp_parse_queued_packet(s, pkt);
         /* return the next packets, if any */
         if(s->st && s->parse_packet) {