From 327a779a81098b39823f7036eba816b8b4c7245f Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 19 Sep 2013 14:33:12 +0200 Subject: mixer: allow accessing volume and mute property on disabled audio The volume is set as soon as the audio chain is created again. This works only in softvol mode. For system wide volume or otherwise externally user controllable volume, this code is intentionally disabled. It would be extremely weird if changing volume (while audio is not initialized) would do nothing, and then suddenly change it when the audio chain is created. There's another odd corner case: the user-set volume will be thrown away if it's set before the _first_ audio chain initialization. This is because the volume restore logic recognizes a change from nothing to softvol or an AO, and circumventing that would require additional code. Also, we don't even know the start volume before that point. Forcing the volume with --volume will can override the volume set during no-audio mode, depending on the situation. --- mpvcore/command.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'mpvcore') diff --git a/mpvcore/command.c b/mpvcore/command.c index ea71b9e082..cb1bdd9678 100644 --- a/mpvcore/command.c +++ b/mpvcore/command.c @@ -762,10 +762,6 @@ static int mp_property_clock(m_option_t *prop, int action, void *arg, static int mp_property_volume(m_option_t *prop, int action, void *arg, MPContext *mpctx) { - - if (!mpctx->sh_audio) - return M_PROPERTY_UNAVAILABLE; - switch (action) { case M_PROPERTY_GET: mixer_getbothvolume(&mpctx->mixer, arg); @@ -789,10 +785,6 @@ static int mp_property_volume(m_option_t *prop, int action, void *arg, static int mp_property_mute(m_option_t *prop, int action, void *arg, MPContext *mpctx) { - - if (!mpctx->sh_audio) - return M_PROPERTY_UNAVAILABLE; - switch (action) { case M_PROPERTY_SET: mixer_setmute(&mpctx->mixer, *(int *) arg); -- cgit v1.2.3