avformat/mux: flush after header writing, like after packets

This makes problematic unconditional flushes in mpegts redundant
And is thus part of a fix for ticket 2748

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-08-03 17:44:56 +02:00
parent b4d525eb63
commit fee982048e
1 changed files with 2 additions and 0 deletions

View File

@ -421,6 +421,8 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
ret = s->pb->error; ret = s->pb->error;
if (ret < 0) if (ret < 0)
return ret; return ret;
if (s->flush_packets && s->pb && s->pb->error >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
avio_flush(s->pb);
} }
if ((ret = init_pts(s)) < 0) if ((ret = init_pts(s)) < 0)