From 88728c6fad99fe6c9cc0b77f95c46d6919f0693a Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 26 Aug 2012 01:19:42 +0200 Subject: core: runtime Matroska edition switching Add a new slave property which switches the current Matroska edition. Since each edition can define an entirely new timeline, switching the edition will simply restart playback at the beginning of the file with the new edition selected. Add 'E' as new keybinding to step the edition property. DVD titles are still separate. Apparently they work similarly, but I don't have any multi-title DVDs for testing. Also, cdda (for audio CDs) uses the same mechanism as DVDs to report a number of titles, so there seems to be confusion what exactly this mechanism is supposed to do. That's why the edition code is completely separate for now. Remove demuxer.num_titles. It was just a rather useless cache for the return value of the DVD titles related STREAM_CTRL. One rather obscure corner case isn't taken care of: if the ordered chapters file has file local options set, they are reset on playback restart. This is unexpected, because edition switching is meant to behave like seeking back to the beginning of the file. --- libmpdemux/demux_mkv.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libmpdemux/demux_mkv.c') diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index b5ab880916..3943bff733 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -856,6 +856,9 @@ static int demux_mkv_read_chapters(struct demuxer *demuxer) "[mkv] Found %d editions, will play #%d (first is 0).\n", num_editions, selected_edition); + demuxer->num_editions = num_editions; + demuxer->edition = selected_edition; + talloc_free(parse_ctx.talloc_ctx); mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] \\---- [ parsing chapters ] ---------\n"); -- cgit v1.2.3