summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-24 01:56:53 +0200
committerwm4 <wm4@nowhere>2014-09-24 01:56:53 +0200
commit735a9c39d7bb7842e92eb04de3ad2eb1a93588ee (patch)
treeb953ab0b226811ac6ee1c2478b8fb6c832f028d7
parent53c288d364c86aae6ec7b0eab40ef31a59d03644 (diff)
downloadmpv-735a9c39d7bb7842e92eb04de3ad2eb1a93588ee.tar.bz2
mpv-735a9c39d7bb7842e92eb04de3ad2eb1a93588ee.tar.xz
player: change --keep-open semantics
By popular request.
-rw-r--r--DOCS/man/options.rst9
-rw-r--r--player/playloop.c4
2 files changed, 11 insertions, 2 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 33431a03e7..70a11e7cc3 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -1430,7 +1430,8 @@ Window
See also ``--screen``.
``--keep-open``
- Do not terminate when playing or seeking beyond the end of the file.
+ Do not terminate when playing or seeking beyond the end of the file, and
+ there is not next file to be played (and ``--loop`` is not used).
Instead, pause the player. When trying to seek beyond end of the file, the
player will pause at an arbitrary playback position (or, in corner cases,
not redraw the window at all).
@@ -1443,6 +1444,12 @@ Window
chapter will terminate playback as well, even if ``--keep-open`` is
given.
+ Since mpv 0.6.0, this doesn't pause if there is a next file in the playlist,
+ or the playlist is looped. Approximately, this will pause when the player
+ would normally exit, but in practice there are corner cases in which this
+ is not the case (e.g. ``mpv --keep-open file.mkv /dev/null`` will play
+ file.mkv normally, then fail to open ``/dev/null``, then exit).
+
``--force-window``
Create a video output window even if there is no video. This can be useful
when pretending that mpv is a GUI application. Currently, the window
diff --git a/player/playloop.c b/player/playloop.c
index fc3259de01..d5c3ac0713 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -764,7 +764,9 @@ static void handle_loop_file(struct MPContext *mpctx)
static void handle_keep_open(struct MPContext *mpctx)
{
struct MPOpts *opts = mpctx->opts;
- if (opts->keep_open && mpctx->stop_play == AT_END_OF_FILE) {
+ if (opts->keep_open && mpctx->stop_play == AT_END_OF_FILE &&
+ !playlist_get_next(mpctx->playlist, 1) && opts->loop_times < 0)
+ {
mpctx->stop_play = KEEP_PLAYING;
if (mpctx->d_video)
mpctx->playback_pts = mpctx->last_vo_pts;