From 8816e1117ee65039dbb5700219ba3537d3e5290e Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 19 May 2018 18:25:54 +0200 Subject: player: change the role of the "stop_play" and "playing" variable Before this, mpctx->playing was often used to determine whether certain new state could be added to the playback state. In particular this affected external files (which added tracks and demuxers). The variable was checked to prevent that they were added before the corresponding uninit code. We want to make a small part of uninit asynchronous, but mpctx->playing needs to stay in the place where it is. It can't be used for this purpose anymore. Use mpctx->stop_play instead. Make it never have the value 0 outside of loading/playback. On unloading, it obviously has to be non-0. Change some other code in playloop.c to use this, because it seems slightly more correct. But mostly this is preparation for the following commit. --- player/core.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'player/core.h') diff --git a/player/core.h b/player/core.h index 39ea2fe07e..193537652b 100644 --- a/player/core.h +++ b/player/core.h @@ -37,12 +37,13 @@ // definitions used internally by the core player code enum stop_play_reason { - KEEP_PLAYING = 0, // must be 0, numeric values of others do not matter + KEEP_PLAYING = 0, // playback of a file is actually going on + // must be 0, numeric values of others do not matter AT_END_OF_FILE, // file has ended, prepare to play next // also returned on unrecoverable playback errors PT_NEXT_ENTRY, // prepare to play next entry in playlist PT_CURRENT_ENTRY, // prepare to play mpctx->playlist->current - PT_STOP, // stop playback, clear playlist + PT_STOP, // stop playback, or transient state when going to next PT_QUIT, // stop playback, quit player PT_ERROR, // play next playlist entry (due to an error) }; -- cgit v1.2.3