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:
cladisch 2009-08-06 09:43:10 +00:00
parent 17cf1efa12
commit 806d0c21c2
1 changed files with 2 additions and 0 deletions

View File

@ -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",