diff options
author | Jan Ekström <jeebjp@gmail.com> | 2018-04-15 01:18:53 +0300 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-04-15 01:18:53 +0300 |
commit | 9de51b6032b5a1ee14fc85017ea9f77f612c7704 (patch) | |
tree | 40d5bf3cd3cda8ddb3d4f1e88938ef326cb3647c /audio/out | |
parent | e00ca83006464ca03e35d04d4a0d0467a7143ff3 (diff) | |
download | mpv-9de51b6032b5a1ee14fc85017ea9f77f612c7704.tar.bz2 mpv-9de51b6032b5a1ee14fc85017ea9f77f612c7704.tar.xz |
ao_openal: document the muted↔gain conversion
This struck me as odd for a moment, so adding a comment.
Diffstat (limited to 'audio/out')
-rw-r--r-- | audio/out/ao_openal.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/audio/out/ao_openal.c b/audio/out/ao_openal.c index 9381d2a906..c1f405bf12 100644 --- a/audio/out/ao_openal.c +++ b/audio/out/ao_openal.c @@ -95,6 +95,9 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg) case AOCONTROL_GET_MUTE: case AOCONTROL_SET_MUTE: { bool mute = *(bool *)arg; + + // openal has no mute control, only gain. + // Thus reverse the muted state to get required gain ALfloat al_mute = (ALfloat)(!mute); if (cmd == AOCONTROL_SET_MUTE) { alSourcef(source, AL_GAIN, al_mute); |