mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
flvdec: always set AVFMTCTX_NOHEADER.
New streams may be created at any time, e.g. on codec change.
This commit is contained in:
parent
0697d81269
commit
ee0dadc109
@ -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");
|
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))
|
s->ctx_flags |= AVFMTCTX_NOHEADER;
|
||||||
!= (FLV_HEADER_FLAG_HASVIDEO|FLV_HEADER_FLAG_HASAUDIO))
|
|
||||||
s->ctx_flags |= AVFMTCTX_NOHEADER;
|
|
||||||
|
|
||||||
if(flags & FLV_HEADER_FLAG_HASVIDEO){
|
if(flags & FLV_HEADER_FLAG_HASVIDEO){
|
||||||
if(!create_stream(s, AVMEDIA_TYPE_VIDEO))
|
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){
|
if(i == s->nb_streams){
|
||||||
st = create_stream(s,
|
st = create_stream(s,
|
||||||
is_audio ? AVMEDIA_TYPE_AUDIO : AVMEDIA_TYPE_VIDEO);
|
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);
|
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))
|
if( (st->discard >= AVDISCARD_NONKEY && !((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY || is_audio))
|
||||||
|
Loading…
Reference in New Issue
Block a user