summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2016-04-07 02:59:39 -0500
committerRodger Combs <rodger.combs@gmail.com>2016-09-12 21:50:32 -0500
commit1f6d7eb47070afc4394348721cd149f940ad2386 (patch)
tree592357ec15ec62b3c9849a710981ef83cb830d3c /libavformat/mux.c
parent5e1bf9d8c0d2cdbbf17b06a5dfdf87a635b3203b (diff)
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.
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 176af59f13..bbfc0fccb8 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -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)