[FFmpeg-cvslog] lavf/matroskaenc: Do not write two CodecID elements for rawvideo.

Carl Eugen Hoyos git at videolan.org
Sat Jan 14 07:08:40 EET 2017


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sat Jan 14 06:06:05 2017 +0100| [c723108e25551cfdb0b1e7e52df6d084ea0348b9] | committer: Carl Eugen Hoyos

lavf/matroskaenc: Do not write two CodecID elements for rawvideo.

Fixes ticket #6068.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c723108e25551cfdb0b1e7e52df6d084ea0348b9
---

 libavformat/matroskaenc.c | 3 ++-
 tests/ref/fate/rgb24-mkv  | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 78a621e..4760fb0 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1119,6 +1119,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
     } else {
         // look for a codec ID string specific to mkv to use,
         // if none are found, use AVI codes
+        if (par->codec_id != AV_CODEC_ID_RAWVIDEO || par->codec_tag) {
         for (j = 0; ff_mkv_codec_tags[j].id != AV_CODEC_ID_NONE; j++) {
             if (ff_mkv_codec_tags[j].id == par->codec_id) {
                 put_ebml_string(pb, MATROSKA_ID_CODECID, ff_mkv_codec_tags[j].str);
@@ -1126,7 +1127,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
                 break;
             }
         }
-        if (par->codec_id == AV_CODEC_ID_RAWVIDEO && !par->codec_tag) {
+        } else {
             if (mkv->allow_raw_vfw) {
                 native_id = 0;
             } else {
diff --git a/tests/ref/fate/rgb24-mkv b/tests/ref/fate/rgb24-mkv
index 88d22c1..4c357ac 100644
--- a/tests/ref/fate/rgb24-mkv
+++ b/tests/ref/fate/rgb24-mkv
@@ -1,5 +1,5 @@
-94cce0d7d5b14b4c86e74a1ca454c5aa *tests/data/fate/rgb24-mkv.matroska
-58361 tests/data/fate/rgb24-mkv.matroska
+55270be3b5d393d770a1dfcb19b68271 *tests/data/fate/rgb24-mkv.matroska
+58345 tests/data/fate/rgb24-mkv.matroska
 #tb 0: 1/10
 #media_type 0: video
 #codec_id 0: rawvideo



More information about the ffmpeg-cvslog mailing list