diff options
Diffstat (limited to 'core/command.c')
-rw-r--r-- | core/command.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/core/command.c b/core/command.c index 7497ea817f..05608c7df4 100644 --- a/core/command.c +++ b/core/command.c @@ -518,19 +518,15 @@ static int mp_property_pause(m_option_t *prop, int action, void *arg, { MPContext *mpctx = ctx; - switch (action) { - case M_PROPERTY_SET: + if (action == M_PROPERTY_SET) { if (*(int *)arg) { pause_player(mpctx); } else { unpause_player(mpctx); } return M_PROPERTY_OK; - case M_PROPERTY_GET: - *(int *)arg = mpctx->paused_user; - return M_PROPERTY_OK; } - return M_PROPERTY_NOT_IMPLEMENTED; + return mp_property_generic_option(prop, action, arg, ctx); } static int mp_property_cache(m_option_t *prop, int action, void *arg, @@ -1365,8 +1361,7 @@ static const m_option_t mp_properties[] = { CONF_RANGE, -2, 10, NULL }, { "metadata", mp_property_metadata, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL }, - { "pause", mp_property_pause, CONF_TYPE_FLAG, - M_OPT_RANGE, 0, 1, NULL }, + M_OPTION_PROPERTY_CUSTOM("pause", mp_property_pause), { "cache", mp_property_cache, CONF_TYPE_INT }, M_OPTION_PROPERTY("pts-association-mode"), M_OPTION_PROPERTY("hr-seek"), @@ -2303,7 +2298,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) pause_player(mpctx); break; case 3: // "pausing_toggle" - if (mpctx->paused_user) + if (opts->pause) unpause_player(mpctx); else pause_player(mpctx); |