10l
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Apr 2008 22:58:04 +0000 (22:58 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Apr 2008 22:58:04 +0000 (22:58 +0000)
Setting AVFMTCTX_NOHEADER if streams<2 so phantom streams are found.
fixes WELCOMETOBELGRADE.flv

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

libavformat/flvdec.c

index 804a217..34bc78d 100644 (file)
@@ -256,6 +256,9 @@ static int flv_read_header(AVFormatContext *s,
         flags = FLV_HEADER_FLAG_HASVIDEO | FLV_HEADER_FLAG_HASAUDIO;
         av_log(s, AV_LOG_WARNING, "Broken FLV file, which says no streams present, this might fail\n");
     }
+    if((flags & (FLV_HEADER_FLAG_HASVIDEO|FLV_HEADER_FLAG_HASAUDIO))
+             != (FLV_HEADER_FLAG_HASVIDEO|FLV_HEADER_FLAG_HASAUDIO))
+        s->ctx_flags |= AVFMTCTX_NOHEADER;
 
     if(flags & FLV_HEADER_FLAG_HASVIDEO){
         if(!create_stream(s, 0))