[FFmpeg-cvslog] r21738 - trunk/libavformat/mpeg.c

michael subversion
Wed Feb 10 15:25:57 CET 2010


Author: michael
Date: Wed Feb 10 15:25:57 2010
New Revision: 21738

Log:
Dont give up after 100kb of zero bytes but returnd EAGAIN
fixes issue1729

Modified:
   trunk/libavformat/mpeg.c

Modified: trunk/libavformat/mpeg.c
==============================================================================
--- trunk/libavformat/mpeg.c	Wed Feb 10 13:44:16 2010	(r21737)
+++ trunk/libavformat/mpeg.c	Wed Feb 10 15:25:57 2010	(r21738)
@@ -247,8 +247,13 @@ static int mpegps_read_pes_header(AVForm
         startcode = find_next_start_code(s->pb, &size, &m->header_state);
         last_sync = url_ftell(s->pb);
     //printf("startcode=%x pos=0x%"PRIx64"\n", startcode, url_ftell(s->pb));
-    if (startcode < 0)
-        return AVERROR(EIO);
+    if (startcode < 0){
+        if(url_feof(s->pb))
+            return AVERROR_EOF;
+        //FIXME we should remember header_state
+        return AVERROR(EAGAIN);
+    }
+
     if (startcode == PACK_START_CODE)
         goto redo;
     if (startcode == SYSTEM_HEADER_START_CODE)



More information about the ffmpeg-cvslog mailing list