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. --- mplayer.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index fd409cc27c..f27551cd1b 100644 --- a/mplayer.c +++ b/mplayer.c @@ -516,6 +516,11 @@ static void print_file_properties(struct MPContext *mpctx, const char *filename) } } } + struct demuxer *demuxer = mpctx->master_demuxer; + if (demuxer->num_editions > 1) + mp_msg(MSGT_CPLAYER, MSGL_INFO, + "Playing edition %d of %d (--edition=%d).\n", + demuxer->edition + 1, demuxer->num_editions, demuxer->edition); for (int t = 0; t < STREAM_TYPE_COUNT; t++) { for (int n = 0; n < mpctx->num_tracks; n++) if (mpctx->tracks[n]->type == t) @@ -4023,6 +4028,10 @@ static void play_files(struct MPContext *mpctx) new_entry = playlist_get_next(mpctx->playlist, +1); } else if (mpctx->stop_play == PT_CURRENT_ENTRY) { new_entry = mpctx->playlist->current; + } else if (mpctx->stop_play == PT_RESTART) { + // The same as PT_CURRENT_ENTRY, unless we decide that the current + // playlist entry can be removed during playback. + new_entry = mpctx->playlist->current; } else { // PT_STOP playlist_clear(mpctx->playlist); } -- cgit v1.2.3