summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-08-16 01:00:29 +0200
committerwm4 <wm4@nowhere>2020-08-16 01:00:29 +0200
commitd6bf3880d74459103a39426275837ec0a1d48e54 (patch)
tree15ab9b967b385f8de0028657d601e1c182e7fcd6
parent112d2a2c500682003798ae60fc6cd0d5dabbe174 (diff)
downloadmpv-d6bf3880d74459103a39426275837ec0a1d48e54.tar.bz2
mpv-d6bf3880d74459103a39426275837ec0a1d48e54.tar.xz
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.
-rw-r--r--demux/demux_mkv_timeline.c5
1 files changed, 5 insertions, 0 deletions
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 "