summaryrefslogtreecommitdiffstats
path: root/mpvcore
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-19 14:33:12 +0200
committerwm4 <wm4@nowhere>2013-09-20 13:23:25 +0200
commit327a779a81098b39823f7036eba816b8b4c7245f (patch)
treeec895e60d3a052573007e0fd690de21b2d171881 /mpvcore
parent7623c94ddce304ac045a86d4b70c1519d672107d (diff)
downloadmpv-327a779a81098b39823f7036eba816b8b4c7245f.tar.bz2
mpv-327a779a81098b39823f7036eba816b8b4c7245f.tar.xz
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.
Diffstat (limited to 'mpvcore')
-rw-r--r--mpvcore/command.c8
1 files changed, 0 insertions, 8 deletions
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);