[FFmpeg-cvslog] flvdec: always set AVFMTCTX_NOHEADER.

Anton Khirnov git at videolan.org
Tue Sep 11 15:34:44 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Sep  1 16:20:58 2012 +0200| [ee0dadc1092cc097356daf967840faa0811409b1] | committer: Anton Khirnov

flvdec: always set AVFMTCTX_NOHEADER.

New streams may be created at any time, e.g. on codec change.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ee0dadc1092cc097356daf967840faa0811409b1
---

 libavformat/flvdec.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 084d012..868cc6b 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -501,9 +501,7 @@ static int flv_read_header(AVFormatContext *s)
         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;
+    s->ctx_flags |= AVFMTCTX_NOHEADER;
 
     if(flags & FLV_HEADER_FLAG_HASVIDEO){
         if(!create_stream(s, AVMEDIA_TYPE_VIDEO))
@@ -714,7 +712,6 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
     if(i == s->nb_streams){
         st = create_stream(s,
             is_audio ? AVMEDIA_TYPE_AUDIO : AVMEDIA_TYPE_VIDEO);
-        s->ctx_flags &= ~AVFMTCTX_NOHEADER;
     }
     av_dlog(s, "%d %X %d \n", is_audio, flags, st->discard);
     if(  (st->discard >= AVDISCARD_NONKEY && !((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY ||         is_audio))



More information about the ffmpeg-cvslog mailing list