summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-04-14 18:22:45 +0200
committerwm4 <wm4@nowhere>2017-04-14 18:22:45 +0200
commit419624fb068ed4e7f449fa4fd0dda8edf161ac1c (patch)
treed74b3c2c12fdf79aa8bb8cc6f289b7b7d7e2ceca /player/command.c
parentae0a40259fa9ce45d34c966da067e20a69156330 (diff)
downloadmpv-419624fb068ed4e7f449fa4fd0dda8edf161ac1c.tar.bz2
mpv-419624fb068ed4e7f449fa4fd0dda8edf161ac1c.tar.xz
player: unmess pause state handling
Merge the pause_player() and unpause_player() functions. Make sure the pause events are emitted properly. We can now set the internal pause state based on a predicate, instead of e.g. handle_pause_on_low_cache() making a mess to trigger the internal pause state as wanted. Preparation for some more changes.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/player/command.c b/player/command.c
index 618e47dcf0..ab2d43984a 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1493,11 +1493,7 @@ static int mp_property_pause(void *ctx, struct m_property *prop,
MPContext *mpctx = ctx;
if (mpctx->playback_initialized && action == M_PROPERTY_SET) {
- if (*(int *)arg) {
- pause_player(mpctx);
- } else {
- unpause_player(mpctx);
- }
+ set_pause_state(mpctx, *(int *)arg);
return M_PROPERTY_OK;
}
return mp_property_generic_option(mpctx, prop, action, arg);
@@ -5018,10 +5014,10 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
if (cmd->is_up_down) {
if (cmd->is_up) {
if (mpctx->step_frames < 1)
- pause_player(mpctx);
+ set_pause_state(mpctx, true);
} else {
if (cmd->repeated) {
- unpause_player(mpctx);
+ set_pause_state(mpctx, false);
} else {
add_step_frame(mpctx, 1);
}