summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-08 21:31:31 +0200
committerwm4 <wm4@nowhere>2015-07-08 21:31:31 +0200
commit15581f2209898bdd1747d4a32f57a00ba5098fdd (patch)
tree6462bf49695bb931d726a0937ad4c974d2006e05 /player/loadfile.c
parent0be07e1d86c4817a3889196de1ae59ae7130fc35 (diff)
downloadmpv-15581f2209898bdd1747d4a32f57a00ba5098fdd.tar.bz2
mpv-15581f2209898bdd1747d4a32f57a00ba5098fdd.tar.xz
player: never overwrite stop_play field
This is a real pain: if a quit command is received, it's set to PT_QUIT. And then other code could overwrite it, making it not quit. The annoying bit is that stop_play is written and read in many places. Just not overwriting it unconditionally seems to be the best course of action.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 3b972f5ffc..dfcb4a547e 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1207,7 +1207,8 @@ reopen_file:
MP_VERBOSE(mpctx, "Starting playback...\n");
if (mpctx->max_frames == 0) {
- mpctx->stop_play = PT_NEXT_ENTRY;
+ if (!mpctx->stop_play)
+ mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->error_playing = 0;
goto terminate_playback;
}
@@ -1415,5 +1416,6 @@ void mp_set_playlist_entry(struct MPContext *mpctx, struct playlist_entry *e)
assert(!e || playlist_entry_to_index(mpctx->playlist, e) >= 0);
mpctx->playlist->current = e;
mpctx->playlist->current_was_replaced = false;
- mpctx->stop_play = PT_CURRENT_ENTRY;
+ if (!mpctx->stop_play)
+ mpctx->stop_play = PT_CURRENT_ENTRY;
}