lavf: add a flag to enable/disable automatic bitstream filtering

This is mostly useful for muxers that wrap other muxers, such as dashenc
and segment. The actual duplicated bitstream filtering is largely harmless,
but delaying the header can cause problems when the muxer intended the header
to be written to a separate file.
This commit is contained in:
Rodger Combs
2016-04-07 02:59:39 -05:00
parent 5e1bf9d8c0
commit 1f6d7eb470
3 changed files with 7 additions and 2 deletions

View File

@@ -500,7 +500,7 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
if ((ret = init_muxer(s, options)) < 0)
return ret;
if (!s->oformat->check_bitstream) {
if (!(s->oformat->check_bitstream && s->flags & AVFMT_FLAG_AUTO_BSF)) {
ret = write_header_internal(s);
if (ret < 0)
goto fail;
@@ -830,6 +830,9 @@ static int do_packet_auto_bsf(AVFormatContext *s, AVPacket *pkt) {
AVStream *st = s->streams[pkt->stream_index];
int i, ret;
if (!(s->flags & AVFMT_FLAG_AUTO_BSF))
return 1;
if (s->oformat->check_bitstream) {
if (!st->internal->bitstream_checked) {
if ((ret = s->oformat->check_bitstream(s, pkt)) < 0)