[FFmpeg-devel] [PATCH 3/3] lavf/matroskaenc: use mkv_check_tag_name consistently; update test
Rodger Combs
rodger.combs at gmail.com
Tue Sep 6 06:26:28 EEST 2016
---
libavformat/matroskaenc.c | 10 +++++-----
tests/fate/matroska.mak | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 7deccaa..3eeb09b 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1342,12 +1342,12 @@ static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int eleme
return 0;
}
-static int mkv_check_tag(AVDictionary *m)
+static int mkv_check_tag(AVDictionary *m, unsigned int elementid)
{
AVDictionaryEntry *t = NULL;
while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX)))
- if (av_strcasecmp(t->key, "title") && av_strcasecmp(t->key, "stereo_mode"))
+ if (mkv_check_tag_name(t->key, elementid))
return 1;
return 0;
@@ -1361,7 +1361,7 @@ static int mkv_write_tags(AVFormatContext *s)
ff_metadata_conv_ctx(s, ff_mkv_metadata_conv, NULL);
- if (mkv_check_tag(s->metadata)) {
+ if (mkv_check_tag(s->metadata, 0)) {
ret = mkv_write_tag(s, s->metadata, 0, 0, &tags);
if (ret < 0) return ret;
}
@@ -1369,7 +1369,7 @@ static int mkv_write_tags(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
- if (!mkv_check_tag(st->metadata))
+ if (!mkv_check_tag(st->metadata, MATROSKA_ID_TAGTARGETS_TRACKUID))
continue;
ret = mkv_write_tag(s, st->metadata, MATROSKA_ID_TAGTARGETS_TRACKUID, i + 1, &tags);
@@ -1398,7 +1398,7 @@ static int mkv_write_tags(AVFormatContext *s)
for (i = 0; i < s->nb_chapters; i++) {
AVChapter *ch = s->chapters[i];
- if (!mkv_check_tag(ch->metadata))
+ if (!mkv_check_tag(ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID))
continue;
ret = mkv_write_tag(s, ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID, ch->id + mkv->chapter_id_offset, &tags);
diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
index 8cf1734..8e4a1e8 100644
--- a/tests/fate/matroska.mak
+++ b/tests/fate/matroska.mak
@@ -4,6 +4,6 @@
FATE_MATROSKA-$(call DEMMUX, MATROSKA, MATROSKA) += fate-matroska-remux
fate-matroska-remux: CMD = md5 -i $(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-2pass-akiyo.webm -color_trc 4 -c:v copy -fflags +bitexact -strict -2 -f matroska
fate-matroska-remux: CMP = oneline
-fate-matroska-remux: REF = 5ebcfaa8e3d534f8a800a58fd2b0aca6
+fate-matroska-remux: REF = f08b20b90f158a4de5a02a52c25596b9
FATE_SAMPLES_AVCONV += $(FATE_MATROSKA-yes)
--
2.9.3
More information about the ffmpeg-devel
mailing list