[FFmpeg-cvslog] r25496 - trunk/libavformat/rtpdec.c

mstorsjo subversion
Fri Oct 15 23:32:21 CEST 2010


Author: mstorsjo
Date: Fri Oct 15 23:32:21 2010
New Revision: 25496

Log:
rtpdec: Return AVERROR(EAGAIN) for mpegts parsing errors

This indicates that there was no error that needs to be reported to the
caller, so we can move on to parse the next packet immediately, if
available. The only error code that ff_mpegts_parse_packet can return
indicates that there was no packet to return from the provided data, for
which it returns -1.

Modified:
   trunk/libavformat/rtpdec.c

Modified: trunk/libavformat/rtpdec.c
==============================================================================
--- trunk/libavformat/rtpdec.c	Fri Oct 15 21:09:54 2010	(r25495)
+++ trunk/libavformat/rtpdec.c	Fri Oct 15 23:32:21 2010	(r25496)
@@ -471,8 +471,11 @@ static int rtp_parse_packet_internal(RTP
     if (!st) {
         /* specific MPEG2TS demux support */
         ret = ff_mpegts_parse_packet(s->ts, pkt, buf, len);
+        /* The only error that can be returned from ff_mpegts_parse_packet
+         * is "no more data to return from the provided buffer", so return
+         * AVERROR(EAGAIN) for all errors */
         if (ret < 0)
-            return ret;
+            return AVERROR(EAGAIN);
         if (ret < len) {
             s->read_buf_size = len - ret;
             memcpy(s->buf, buf + ret, s->read_buf_size);
@@ -634,7 +637,7 @@ static int rtp_parse_one_packet(RTPDemux
             ret = ff_mpegts_parse_packet(s->ts, pkt, s->buf + s->read_buf_index,
                                       s->read_buf_size - s->read_buf_index);
             if (ret < 0)
-                return ret;
+                return AVERROR(EAGAIN);
             s->read_buf_index += ret;
             if (s->read_buf_index < s->read_buf_size)
                 return 1;



More information about the ffmpeg-cvslog mailing list