mirror of
https://github.com/mpv-player/mpv
synced 2024-12-29 18:42:09 +00:00
Do not leak the mixer handle if setting of a volume fails.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29478 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
17cf1efa12
commit
806d0c21c2
@ -209,6 +209,7 @@ static int control(int cmd, void *arg)
|
||||
if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, set_vol)) < 0) {
|
||||
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingLeftChannel,
|
||||
snd_strerror(err));
|
||||
snd_mixer_close(handle);
|
||||
return CONTROL_ERROR;
|
||||
}
|
||||
mp_msg(MSGT_AO,MSGL_DBG2,"left=%li, ", set_vol);
|
||||
@ -218,6 +219,7 @@ static int control(int cmd, void *arg)
|
||||
if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, set_vol)) < 0) {
|
||||
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingRightChannel,
|
||||
snd_strerror(err));
|
||||
snd_mixer_close(handle);
|
||||
return CONTROL_ERROR;
|
||||
}
|
||||
mp_msg(MSGT_AO,MSGL_DBG2,"right=%li, pmin=%li, pmax=%li, mult=%f\n",
|
||||
|
Loading…
Reference in New Issue
Block a user