aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/nutenc.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2015-09-03 17:31:14 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-11-02 12:10:38 +0100
commit1e7ff5ac6923996f7292c82f102c68384fbc9d97 (patch)
treeffde4ddc69d4612d4606121ba250e7800c4fdaf2 /libavformat/nutenc.c
parent8161220eee152dad8b2ea9e2755c78c8e127f747 (diff)
downloadffmpeg-1e7ff5ac6923996f7292c82f102c68384fbc9d97.tar.gz
nut: Use the correct codec_tag when multiple are available
Some codecs use the codec_tag to signal specific information and picking the first one would lead to a broken file. Bug-Id: 883 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/nutenc.c')
-rw-r--r--libavformat/nutenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index b7b0c9c790..be6579dadb 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -438,7 +438,8 @@ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc,
}
ff_put_v(bc, 4);
- if (!codec_tag || codec->codec_id == AV_CODEC_ID_RAWVIDEO)
+ if (av_codec_get_id(ff_nut_codec_tags, codec->codec_tag) == codec->codec_id ||
+ !codec_tag || codec->codec_id == AV_CODEC_ID_RAWVIDEO)
codec_tag = codec->codec_tag;
if (codec_tag) {