summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-26 01:19:42 +0200
committerwm4 <wm4@nowhere>2012-09-18 21:04:45 +0200
commit88728c6fad99fe6c9cc0b77f95c46d6919f0693a (patch)
tree202bba034426f78e3ffcd20a9b9d660a0be8d86a /mplayer.c
parent7236ad5ff2dd67e069b3fb2bf9adc1e0f2135e6f (diff)
downloadmpv-88728c6fad99fe6c9cc0b77f95c46d6919f0693a.tar.bz2
mpv-88728c6fad99fe6c9cc0b77f95c46d6919f0693a.tar.xz
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.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c9
1 files changed, 9 insertions, 0 deletions
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);
}