summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-04-26 21:45:50 +0200
committerwm4 <wm4@nowhere>2017-04-26 21:45:55 +0200
commitf1c4d20e6577f32018e20efc4ab9da7d4e1ab4ac (patch)
treeb9c6c26faefce976496c527d524cd2e09a96b29f /player/command.c
parent010c7d499258c1064189b2d149ae6eca859d9ae1 (diff)
downloadmpv-f1c4d20e6577f32018e20efc4ab9da7d4e1ab4ac.tar.bz2
mpv-f1c4d20e6577f32018e20efc4ab9da7d4e1ab4ac.tar.xz
audio: move replaygain control to top-level options
af_volume is deprecated, and so are its replaygain sub-options. To make it possible to use replaygain without deprecated options (and of course to make it available at all after af_volume is dropped), reintroduce them as top-level options. This also means that they are easily changeable at runtime by using them as properties. Change the "volume" property to use the new update mechanism as well. We don't actually bother sharing the implementation between new and deprecated mechanisms, as the deprecated one will simply be deleted. For the from_dB() functions, we mention anders' copyright, although I'm not sure if a mere formula is copyrightable. This will have to be determined later. This whole change is mostly untested. Our distributed human CI will take care of it.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/player/command.c b/player/command.c
index 73081e89f9..ad871e34b3 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1820,10 +1820,7 @@ static int mp_property_volume(void *ctx, struct m_property *prop,
return M_PROPERTY_OK;
}
- int r = mp_property_generic_option(mpctx, prop, action, arg);
- if (action == M_PROPERTY_SET)
- audio_update_volume(mpctx);
- return r;
+ return mp_property_generic_option(mpctx, prop, action, arg);
}
/// Mute (RW)
@@ -5798,6 +5795,9 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags)
if (flags & UPDATE_SCREENSAVER)
update_screensaver_state(mpctx);
+
+ if (flags & UPDATE_VOL)
+ audio_update_volume(mpctx);
}
void mp_notify_property(struct MPContext *mpctx, const char *property)