aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-09-23 21:54:24 -0300
committerJames Almer <jamrial@gmail.com>2018-09-24 16:15:30 -0300
commite50cb8b2f440aa590f06dde0b592b312fafc85eb (patch)
tree762a9c60368bb24365e66dc913baf96e0b7883bf
parent54ca198e236039b81f3da9bb098b9abd31223c65 (diff)
downloadffmpeg-e50cb8b2f440aa590f06dde0b592b312fafc85eb.tar.gz
avformat/ivfenc: fix writing codec tag
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>
-rw-r--r--libavformat/ivfenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c
index af803d59ee..66441a2a43 100644
--- a/libavformat/ivfenc.c
+++ b/libavformat/ivfenc.c
@@ -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);