[FFmpeg-devel] [PATCH 3/5] lavf/mpeg: use FFERROR_REDO instead of AVERROR(EAGAIN).

Nicolas George george at nsup.org
Fri Nov 27 19:16:08 CET 2015


Signed-off-by: Nicolas George <george at nsup.org>
---
 libavformat/mpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Problem can be observed with files containing large portions of junk, for
example:

{ ffmpeg -lavfi testsrc=d=60 -f vob -;
  head -c $[256*1024*1024] /dev/zero;
  ffmpeg -lavfi testsrc=d=60 -f vob - } > big.mpg
ffmpeg -i big.mpg -f null -

Observe the time getting stuck after 60 seconds.


diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index fb77d89..69685cf 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -256,7 +256,7 @@ redo:
         if (avio_feof(s->pb))
             return AVERROR_EOF;
         // FIXME we should remember header_state
-        return AVERROR(EAGAIN);
+        return FFERROR_REDO;
     }
 
     if (startcode == PACK_START_CODE)
-- 
2.6.2



More information about the ffmpeg-devel mailing list