diff options
author | wm4 <wm4@nowhere> | 2016-07-09 19:34:45 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-07-09 19:34:45 +0200 |
commit | d47b708f00663a09df743e3dadf0cf366ecdb4c0 (patch) | |
tree | 91f647a583078704364aa01492d1244dbd26a13c /audio | |
parent | 2fb2f9b93a8ae3d275603311b7fad255cbaf3ab6 (diff) | |
download | mpv-d47b708f00663a09df743e3dadf0cf366ecdb4c0.tar.bz2 mpv-d47b708f00663a09df743e3dadf0cf366ecdb4c0.tar.xz |
audio: don't crash when changing volume if no audio is initialized
Oversight.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/mixer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/audio/mixer.c b/audio/mixer.c index a251a5aa60..a58a814649 100644 --- a/audio/mixer.c +++ b/audio/mixer.c @@ -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; |