[FFmpeg-devel] [PATCH] [PATCH]: Fix AVI demuxing when the input is in streaming mode.

Thierry Foucu tfoucu at gmail.com
Thu Mar 28 01:47:03 CET 2013


---
 libavformat/avidec.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index f6eb71e..121033f 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -374,9 +374,13 @@ static int avi_read_header(AVFormatContext *s)
 
     av_log(avi, AV_LOG_DEBUG, "use odml:%d\n", avi->use_odml);
 
-    avi->io_fsize = avi->fsize = avio_size(pb);
-    if(avi->fsize<=0 || avi->fsize < avi->riff_end)
-        avi->fsize= avi->riff_end == 8 ? INT64_MAX : avi->riff_end;
+    if (pb->seekable) {
+        avi->io_fsize = avi->fsize = avio_size(pb);
+        if(avi->fsize<=0 || avi->fsize < avi->riff_end)
+            avi->fsize= avi->riff_end == 8 ? INT64_MAX : avi->riff_end;
+    } else {
+        avi->fsize = avi->riff_end = INT64_MAX;
+    }
 
     /* first list tag */
     stream_index = -1;
-- 
1.8.1.3



More information about the ffmpeg-devel mailing list