[MPlayer-cvslog] r29478 - trunk/libao2/ao_alsa.c

cladisch subversion at mplayerhq.hu
Thu Aug 6 11:43:11 CEST 2009


Author: cladisch
Date: Thu Aug  6 11:43:10 2009
New Revision: 29478

Log:
Do not leak the mixer handle if setting of a volume fails.

Modified:
   trunk/libao2/ao_alsa.c

Modified: trunk/libao2/ao_alsa.c
==============================================================================
--- trunk/libao2/ao_alsa.c	Thu Aug  6 01:16:21 2009	(r29477)
+++ trunk/libao2/ao_alsa.c	Thu Aug  6 11:43:10 2009	(r29478)
@@ -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",


More information about the MPlayer-cvslog mailing list