From d6bf3880d74459103a39426275837ec0a1d48e54 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 16 Aug 2020 01:00:29 +0200 Subject: demux_mkv: warn against some other aspects of mismatching codec data Such files violate the specification. Unfortunately, I could not test whether it really works correctly, since I don't have a sample at hand that is not broken in this regard. --- demux/demux_mkv_timeline.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/demux/demux_mkv_timeline.c b/demux/demux_mkv_timeline.c index 1062aa3685..0c23e27d25 100644 --- a/demux/demux_mkv_timeline.c +++ b/demux/demux_mkv_timeline.c @@ -494,6 +494,11 @@ static void check_track_compatibility(struct tl_ctx *tl, struct demuxer *mainsrc // match (though mpv's implementation doesn't care). if (strcmp(s->codec->codec, m->codec->codec) != 0) MP_WARN(tl, "Timeline segments have mismatching codec.\n"); + if (s->codec->extradata_size != m->codec->extradata_size || + (s->codec->extradata_size && + memcmp(s->codec->extradata, m->codec->extradata, + s->codec->extradata_size) != 0)) + MP_WARN(tl, "Timeline segments have mismatching codec info.\n"); } else { MP_WARN(tl, "Source %s lacks %s stream with TID=%d, which " "is present in the ordered chapters main " -- cgit v1.2.3