[Mplayer-cvslog] CVS: 0_90/libao2 ao_nas.c,1.11,1.12

Arpi of Ize arpi at mplayerhq.hu
Mon Mar 17 01:51:34 CET 2003


Update of /cvsroot/mplayer/0_90/libao2
In directory mail:/var/tmp.root/cvs-serv21808

Modified Files:
	ao_nas.c 
Log Message:
backport: leak fix? + debug prints.


Index: ao_nas.c
===================================================================
RCS file: /cvsroot/mplayer/0_90/libao2/ao_nas.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ao_nas.c	24 Nov 2002 23:13:15 -0000	1.11
+++ ao_nas.c	17 Mar 2003 00:51:32 -0000	1.12
@@ -339,6 +339,8 @@
 	AuFixedPoint fpgain;
 	AuStatus as;
 	int gain;
+	int retval = CONTROL_UNKNOWN;
+
 	ao_control_vol_t *vol = (ao_control_vol_t *)arg;
 
 	dattr = AuGetDeviceAttributes(nas_data->aud, nas_data->dev, &as);
@@ -356,7 +358,9 @@
 		vol->right = (float) gain;
 		vol->left = vol->right;
 
-		return CONTROL_OK;
+		mp_msg(MSGT_AO, MSGL_DBG2, "ao_nas: AOCONTROL_GET_VOLUME: %d\n", gain);
+		retval = CONTROL_OK;
+		break;
 
 	case AOCONTROL_SET_VOLUME:
 		/*
@@ -365,6 +369,7 @@
 		 * so i take the mean of both values.
 		 */
 		gain = (int) ((vol->left+vol->right)/2);
+		mp_msg(MSGT_AO, MSGL_DBG2, "ao_nas: AOCONTROL_SET_VOLUME: %d\n", gain);
 
 		fpgain = AuFixedPointFromSum(gain, 0);
 		AuDeviceGain(dattr) = fpgain;
@@ -373,13 +378,13 @@
 		if (as != AuSuccess) {
 			nas_print_error(nas_data->aud,
 			                "control(): AuSetDeviceAttributes", as);
-			return CONTROL_ERROR;
-		}
-		return CONTROL_OK;
-
-	default:
-		return CONTROL_UNKNOWN;
+			retval = CONTROL_ERROR;
+		} else retval = CONTROL_OK;
+		break;
 	};
+
+	AuFreeDeviceAttributes(nas_data->aud, 1, dattr);
+	return retval;
 }
 
 // open & setup audio device



More information about the MPlayer-cvslog mailing list