summaryrefslogtreecommitdiff
path: root/libavformat/ffmenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-12-01 16:58:37 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-12-02 19:37:00 +0100
commite8215b77ff46aac12e9545153946ad306a18521c (patch)
treebfbb173c1165d113e4162e77cb1b3ef28fcb3116 /libavformat/ffmenc.c
parentc06d4f2cedb76f2a38732ff45d12b584d2900c19 (diff)
avformat/ffmenc: set bitexact mode for old API without accessing the encoder
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/ffmenc.c')
-rw-r--r--libavformat/ffmenc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
index 221f0a2cfd..7ed4320fed 100644
--- a/libavformat/ffmenc.c
+++ b/libavformat/ffmenc.c
@@ -223,6 +223,7 @@ static int ffm_write_header(AVFormatContext *s)
/* list of streams */
for(i=0;i<s->nb_streams;i++) {
+ int flags = 0;
st = s->streams[i];
avpriv_set_pts_info(st, 64, 1, 1000000);
if(avio_open_dyn_buf(&pb) < 0)
@@ -234,7 +235,16 @@ static int ffm_write_header(AVFormatContext *s)
avio_wb32(pb, codecpar->codec_id);
avio_w8(pb, codecpar->codec_type);
avio_wb32(pb, codecpar->bit_rate);
- avio_wb32(pb, codecpar->extradata_size ? AV_CODEC_FLAG_GLOBAL_HEADER : 0);
+ if (codecpar->extradata_size)
+ flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ // If the user is not providing us with a configuration we have to fill it in as we cannot access the encoder
+ if (!st->recommended_encoder_configuration) {
+ if (s->flags & AVFMT_FLAG_BITEXACT)
+ flags |= AV_CODEC_FLAG_BITEXACT;
+ }
+
+ avio_wb32(pb, flags);
avio_wb32(pb, 0); // flags2
avio_wb32(pb, 0); // debug
if (codecpar->extradata_size) {