summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-12 23:45:16 +0100
committerwm4 <wm4@nowhere>2014-12-12 23:45:16 +0100
commit98e400216d7c6545ffd7d1909c7bfac09b9862f3 (patch)
tree7433f8b5448fc5a7398edc76e6ba23e372e781bc /player/playloop.c
parent2768ded1b981e43a3bd15d9fe6bb0cf3a303254d (diff)
downloadmpv-98e400216d7c6545ffd7d1909c7bfac09b9862f3.tar.bz2
mpv-98e400216d7c6545ffd7d1909c7bfac09b9862f3.tar.xz
player: add a --keep-open=always mode
The --keep-open behavior was recently changed to act only on the last file due to user requests (see commit 735a9c39). But the old behavior was useful too, so bring it back as an additional mode. Fixes #1332 (or rather, should help with it).
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 6d680a0780..42f01ce473 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -807,7 +807,8 @@ static void handle_keep_open(struct MPContext *mpctx)
{
struct MPOpts *opts = mpctx->opts;
if (opts->keep_open && mpctx->stop_play == AT_END_OF_FILE &&
- !playlist_get_next(mpctx->playlist, 1) && opts->loop_times < 0)
+ (opts->keep_open == 2 || !playlist_get_next(mpctx->playlist, 1)) &&
+ opts->loop_times < 0)
{
mpctx->stop_play = KEEP_PLAYING;
if (mpctx->d_video) {