diff mbox

[FFmpeg-devel] lavf/matroskaenc: Always write V_QUICKTIME extradata.

Message ID 201609291625.23693.cehoyos@ag.or.at
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Sept. 29, 2016, 2:25 p.m. UTC
Hi!

Attached patch should fix ticket #5872.

Please comment, Carl Eugen
From 46e8d6919abdeb3d6153878fc815de9202b7eec1 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos@ag.or.at>
Date: Thu, 29 Sep 2016 16:23:14 +0200
Subject: [PATCH] lavf/matroskaenc: Always write V_QUICKTIME extradata.

Fixes ticket #5872.
---
 libavformat/matroskaenc.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox

Patch

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 3eeb09b..f2896a5 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -683,9 +683,8 @@  static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb,
             if (!par->codec_tag)
                 par->codec_tag = ff_codec_get_tag(ff_codec_movvideo_tags,
                                                     par->codec_id);
-            if (par->extradata_size) {
                 if (   ff_codec_get_id(ff_codec_movvideo_tags, par->codec_tag) == par->codec_id
-                    && ff_codec_get_id(ff_codec_movvideo_tags, AV_RL32(par->extradata + 4)) != par->codec_id
+                    && (!par->extradata_size || ff_codec_get_id(ff_codec_movvideo_tags, AV_RL32(par->extradata + 4)) != par->codec_id)
                 ) {
                     int i;
                     avio_wb32(dyn_cp, 0x5a + par->extradata_size);
@@ -694,7 +693,6 @@  static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb,
                         avio_w8(dyn_cp, 0);
                 }
                 avio_write(dyn_cp, par->extradata, par->extradata_size);
-            }
         } else {
             if (!ff_codec_get_tag(ff_codec_bmp_tags, par->codec_id))
                 av_log(s, AV_LOG_WARNING, "codec %s is not supported by this format\n",