Commit c723108e authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

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

Fixes ticket #6068.
parent 1412e5a0
...@@ -1119,6 +1119,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv, ...@@ -1119,6 +1119,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
} else { } else {
// look for a codec ID string specific to mkv to use, // look for a codec ID string specific to mkv to use,
// if none are found, use AVI codes // 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++) { for (j = 0; ff_mkv_codec_tags[j].id != AV_CODEC_ID_NONE; j++) {
if (ff_mkv_codec_tags[j].id == par->codec_id) { if (ff_mkv_codec_tags[j].id == par->codec_id) {
put_ebml_string(pb, MATROSKA_ID_CODECID, ff_mkv_codec_tags[j].str); 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, ...@@ -1126,7 +1127,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
break; break;
} }
} }
if (par->codec_id == AV_CODEC_ID_RAWVIDEO && !par->codec_tag) { } else {
if (mkv->allow_raw_vfw) { if (mkv->allow_raw_vfw) {
native_id = 0; native_id = 0;
} else { } else {
......
94cce0d7d5b14b4c86e74a1ca454c5aa *tests/data/fate/rgb24-mkv.matroska 55270be3b5d393d770a1dfcb19b68271 *tests/data/fate/rgb24-mkv.matroska
58361 tests/data/fate/rgb24-mkv.matroska 58345 tests/data/fate/rgb24-mkv.matroska
#tb 0: 1/10 #tb 0: 1/10
#media_type 0: video #media_type 0: video
#codec_id 0: rawvideo #codec_id 0: rawvideo
......
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