Commit 1e7ff5ac authored by Luca Barbato's avatar Luca Barbato

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: 's avatarLuca Barbato <lu_zero@gentoo.org>
parent 8161220e
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment