diff options
author | wm4 <wm4@nowhere> | 2018-05-19 18:25:54 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2018-05-24 19:56:35 +0200 |
commit | 8816e1117ee65039dbb5700219ba3537d3e5290e (patch) | |
tree | 346500d09a27d91a1cd5c4e987b052e635e64978 /player/command.c | |
parent | c24520b7f3651dbd4cbdffe93a187c3d213ff845 (diff) | |
download | mpv-8816e1117ee65039dbb5700219ba3537d3e5290e.tar.bz2 mpv-8816e1117ee65039dbb5700219ba3537d3e5290e.tar.xz |
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.
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c index 4c46203ab4..efd1304720 100644 --- a/player/command.c +++ b/player/command.c @@ -5522,7 +5522,7 @@ static void cmd_track_add(void *p) struct MPContext *mpctx = cmd->mpctx; int type = *(int *)cmd->priv; - if (!mpctx->playing) { + if (mpctx->stop_play) { cmd->success = false; return; } @@ -5623,7 +5623,7 @@ static void cmd_rescan_external_files(void *p) struct mp_cmd_ctx *cmd = p; struct MPContext *mpctx = cmd->mpctx; - if (!mpctx->playing) { + if (mpctx->stop_play) { cmd->success = false; return; } |