diff libao2/ao_alsa5.c @ 26757:0fdf04b07ecb

cosmetics: Remove pointless parentheses from return statements.
author diego
date Fri, 16 May 2008 09:31:55 +0000
parents 99e20a22d5d0
children e45b08f2f5d3
line wrap: on
line diff
--- a/libao2/ao_alsa5.c	Fri May 16 08:43:15 2008 +0000
+++ b/libao2/ao_alsa5.c	Fri May 16 09:31:55 2008 +0000
@@ -35,7 +35,7 @@
 /* to set/get/query special features/parameters */
 static int control(int cmd, void *arg)
 {
-    return(CONTROL_UNKNOWN);
+    return CONTROL_UNKNOWN;
 }
 
 /*
@@ -62,7 +62,7 @@
     if ((cards = snd_cards()) < 0)
     {
 	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_SoundCardNotFound);
-	return(0);
+	return 0;
     }
 
     ao_data.format = format;
@@ -112,7 +112,7 @@
 	    break;
 	case -1:
 	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_InvalidFormatReq,af_fmt2str_short(format));
-	    return(0);
+	    return 0;
 	default:
 	    break;
     }
@@ -164,13 +164,13 @@
     if ((err = snd_pcm_open(&alsa_handler, 0, 0, SND_PCM_OPEN_PLAYBACK)) < 0)
     {
 	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PlayBackError, snd_strerror(err));
-	return(0);
+	return 0;
     }
 
     if ((err = snd_pcm_info(alsa_handler, &info)) < 0)
     {
 	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PcmInfoError, snd_strerror(err));
-	return(0);
+	return 0;
     }
 
     mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_ALSA5_SoundcardsFound,
@@ -183,7 +183,7 @@
 	if ((err = snd_pcm_channel_info(alsa_handler, &chninfo)) < 0)
 	{
 	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PcmChanInfoError, snd_strerror(err));
-	    return(0);
+	    return 0;
 	}
 
 #ifndef __QNX__
@@ -207,7 +207,7 @@
     if ((err = snd_pcm_channel_params(alsa_handler, &params)) < 0)
     {
 	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_CantSetParms, snd_strerror(err));
-	return(0);
+	return 0;
     }
 
     memset(&setup, 0, sizeof(setup));
@@ -220,19 +220,19 @@
     if ((err = snd_pcm_channel_setup(alsa_handler, &setup)) < 0)
     {
 	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_CantSetChan, snd_strerror(err));
-	return(0);
+	return 0;
     }
 
     if ((err = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0)
     {
 	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ChanPrepareError, snd_strerror(err));
-	return(0);
+	return 0;
     }
 
     mp_msg(MSGT_AO, MSGL_INFO, "AUDIO: %d Hz/%d channels/%d bps/%d bytes buffer/%s\n",
 	ao_data.samplerate, ao_data.channels, ao_data.bps, ao_data.buffersize,
 	snd_pcm_get_format_name(alsa_format.format));
-    return(1);
+    return 1;
 }
 
 /* close audio device */
@@ -321,7 +321,7 @@
     int got_len;
     
     if (!len)
-	return(0);
+	return 0;
     
     if ((got_len = snd_pcm_write(alsa_handler, data, len)) < 0)
     {
@@ -331,20 +331,20 @@
 	    if ((got_len = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0)
 	    {
 		mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PlaybackPrepareError, snd_strerror(got_len));
-		return(0);
+		return 0;
 	    }
 	    if ((got_len = snd_pcm_write(alsa_handler, data, len)) < 0)
 	    {
 		mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_WriteErrorAfterReset,
 		    snd_strerror(got_len));
-		return(0);
+		return 0;
 	    }
-	    return(got_len); /* 2nd write was ok */
+	    return got_len; /* 2nd write was ok */
 	}
 	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_OutPutError, snd_strerror(got_len));
-	return(0);
+	return 0;
     }
-    return(got_len);
+    return got_len;
 }
 
 /* how many byes are free in the buffer */
@@ -355,9 +355,9 @@
     ch_stat.channel = SND_PCM_CHANNEL_PLAYBACK;
 
     if (snd_pcm_channel_status(alsa_handler, &ch_stat) < 0)
-	return(0); /* error occurred */
+	return 0; /* error occurred */
     else
-	return(ch_stat.free);
+	return ch_stat.free;
 }
 
 /* delay in seconds between first and last sample in buffer */
@@ -368,7 +368,7 @@
     ch_stat.channel = SND_PCM_CHANNEL_PLAYBACK;
     
     if (snd_pcm_channel_status(alsa_handler, &ch_stat) < 0)
-	return((float)ao_data.buffersize/(float)ao_data.bps); /* error occurred */
+	return (float)ao_data.buffersize/(float)ao_data.bps; /* error occurred */
     else
-	return((float)ch_stat.count/(float)ao_data.bps);
+	return (float)ch_stat.count/(float)ao_data.bps;
 }