1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 17:42:17 +00:00

audio: don't crash when changing volume if no audio is initialized

Oversight.
This commit is contained in:
wm4 2016-07-09 19:34:45 +02:00
parent 2fb2f9b93a
commit d47b708f00

View File

@ -57,6 +57,9 @@ bool mixer_audio_initialized(struct mixer *mixer)
// Called when opts->softvol_volume or opts->softvol_mute were changed.
void mixer_update_volume(struct mixer *mixer)
{
if (!mixer->af)
return;
float gain = MPMAX(mixer->opts->softvol_volume / 100.0, 0);
if (mixer->opts->softvol_mute == 1)
gain = 0.0;