From 15581f2209898bdd1747d4a32f57a00ba5098fdd Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 8 Jul 2015 21:31:31 +0200 Subject: 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. --- player/loadfile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'player/loadfile.c') 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; } -- cgit v1.2.3