]> git.sesse.net Git - ffmpeg/commitdiff
avformat/ivfenc: fix writing codec tag
authorJames Almer <jamrial@gmail.com>
Mon, 24 Sep 2018 00:54:24 +0000 (21:54 -0300)
committerJames Almer <jamrial@gmail.com>
Mon, 24 Sep 2018 19:15:30 +0000 (16:15 -0300)
The value in AVCodecParameters->codec_tag may not be correct for IVF,
as it's the case when remuxing AV1 streams from mp4, so ignore it and
write the correct value based on codec ID instead.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/ivfenc.c

index af803d59ee80c8965a38f1a519e2c22c20d060e1..66441a2a4330482fdd4650fb5833aae2ad8efc47 100644 (file)
@@ -46,7 +46,7 @@ static int ivf_write_header(AVFormatContext *s)
     avio_write(pb, "DKIF", 4);
     avio_wl16(pb, 0); // version
     avio_wl16(pb, 32); // header length
-    avio_wl32(pb, par->codec_tag ? par->codec_tag :
+    avio_wl32(pb,
               par->codec_id == AV_CODEC_ID_VP9 ? AV_RL32("VP90") :
               par->codec_id == AV_CODEC_ID_VP8 ? AV_RL32("VP80") : AV_RL32("AV01"));
     avio_wl16(pb, par->width);