From 14607f27ef01c81e4544d0eaa7ed182001c15305 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 27 Feb 2014 01:07:46 +0100 Subject: command: use the step size for "add volume" commands The step argument for "add volume " was ignored until now. Fix it. There is one problem: by defualt, "add volume" should use the value set with --volstep. This value is 3 by default. Since the default volue for the step argument is always 1 (and we don't really want to make the generic code more complicated by introducing custom step sizes), we simply multiply the step argument with --volstep to keep it compatible. The --volstep option should probably be just removed in the future. --- player/command.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index 7712a6e550..4997056be4 100644 --- a/player/command.c +++ b/player/command.c @@ -931,10 +931,7 @@ static int mp_property_volume(m_option_t *prop, int action, void *arg, if (!mixer_audio_initialized(mpctx->mixer)) return M_PROPERTY_ERROR; struct m_property_switch_arg *sarg = arg; - if (sarg->inc <= 0) - mixer_decvolume(mpctx->mixer); - else - mixer_incvolume(mpctx->mixer); + mixer_addvolume(mpctx->mixer, mpctx->opts->volstep * sarg->inc); return M_PROPERTY_OK; } } -- cgit v1.2.3