summaryrefslogtreecommitdiffstats
path: root/demux/demux_mkv.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2016-10-22 18:55:31 +0300
committerwm4 <wm4@nowhere>2016-10-22 18:45:06 +0200
commit18681a7dd26cacac9a9df9aac696d5c4f172b34d (patch)
tree60e584e11f56ca9a61e17188573b577370c43ce3 /demux/demux_mkv.c
parent3a78eefc88ecb354d1415f43bbf19d57caa31918 (diff)
downloadmpv-18681a7dd26cacac9a9df9aac696d5c4f172b34d.tar.bz2
mpv-18681a7dd26cacac9a9df9aac696d5c4f172b34d.tar.xz
demux_mkv: fix ordered chapter sources with ordered editions
Commit f72a900892 (and others) added support for ordered editions that recursively refer to other ordered editions. However, this recursion code incorrectly activated if the source files had ordered chapters even if the main file only wanted to use them as raw video, resulting in broken timeline info overall. Ordered chapters can specify a ChapterSegmentEditionUID value if they want to use a specific edition from a source file. Otherwise the source is supposed to be used as a raw video file. The code checked demuxer->matroska_data.num_ordered_chapters for an opened source file to see whether it was using a recursive ordered edition, but demux_mkv could enable a default ordered edition for the file using the normal playback rules even if the main file had not specified any ChapterSegmentEditionUID. Thus this incorrectly enabled recursion if a source file had a default edition using ordered chapters. Check demuxer->matroska_data.uid.edition instead, and ensure it's never set if a file is opened without ChapterSegmentEditionUID. Also fix what seems like a memory leak in demux_mkv.c. Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'demux/demux_mkv.c')
-rw-r--r--demux/demux_mkv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
index 95eab29ec9..b9e723a53c 100644
--- a/demux/demux_mkv.c
+++ b/demux/demux_mkv.c
@@ -862,6 +862,7 @@ static int demux_mkv_read_chapters(struct demuxer *demuxer)
if (wanted_edition_uid) {
MP_ERR(demuxer, "Unable to find expected edition uid: %"PRIu64"\n",
wanted_edition_uid);
+ talloc_free(parse_ctx.talloc_ctx);
return -1;
} else {
selected_edition = 0;