aboutsummaryrefslogtreecommitdiffhomepage
path: root/libao2
diff options
context:
space:
mode:
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_alsa.c30
-rw-r--r--libao2/ao_alsa5.c40
-rw-r--r--libao2/ao_arts.c2
-rw-r--r--libao2/ao_sdl.c2
4 files changed, 37 insertions, 37 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c
index 53a9768730..0d925ce9e3 100644
--- a/libao2/ao_alsa.c
+++ b/libao2/ao_alsa.c
@@ -232,7 +232,7 @@ static int control(int cmd, void *arg)
}
} //end switch
- return(CONTROL_UNKNOWN);
+ return CONTROL_UNKNOWN;
}
static void parse_device (char *dest, const char *src, int len)
@@ -498,11 +498,11 @@ static int init(int rate_hz, int channels, int format, int flags)
mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_OpenInNonblockModeFailed);
if ((err = try_open_device(alsa_device, 0, format == AF_FORMAT_AC3)) < 0) {
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err));
- return(0);
+ return 0;
}
} else {
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err));
- return(0);
+ return 0;
}
}
@@ -520,7 +520,7 @@ static int init(int rate_hz, int channels, int format, int flags)
{
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToGetInitialParameters,
snd_strerror(err));
- return(0);
+ return 0;
}
err = snd_pcm_hw_params_set_access(alsa_handler, alsa_hwparams,
@@ -528,7 +528,7 @@ static int init(int rate_hz, int channels, int format, int flags)
if (err < 0) {
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetAccessType,
snd_strerror(err));
- return (0);
+ return 0;
}
/* workaround for nonsupported formats
@@ -547,7 +547,7 @@ static int init(int rate_hz, int channels, int format, int flags)
{
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetFormat,
snd_strerror(err));
- return(0);
+ return 0;
}
if ((err = snd_pcm_hw_params_set_channels_near(alsa_handler, alsa_hwparams,
@@ -555,7 +555,7 @@ static int init(int rate_hz, int channels, int format, int flags)
{
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetChannels,
snd_strerror(err));
- return(0);
+ return 0;
}
/* workaround for buggy rate plugin (should be fixed in ALSA 1.0.11)
@@ -566,7 +566,7 @@ static int init(int rate_hz, int channels, int format, int flags)
{
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToDisableResampling,
snd_strerror(err));
- return(0);
+ return 0;
}
#endif
@@ -575,7 +575,7 @@ static int init(int rate_hz, int channels, int format, int flags)
{
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetSamplerate2,
snd_strerror(err));
- return(0);
+ return 0;
}
bytes_per_sample = snd_pcm_format_physical_width(alsa_format) / 8;
@@ -592,7 +592,7 @@ static int init(int rate_hz, int channels, int format, int flags)
{
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetBufferTimeNear,
snd_strerror(err));
- return(0);
+ return 0;
} else
alsa_buffer_time = err;
@@ -711,7 +711,7 @@ static int init(int rate_hz, int channels, int format, int flags)
} // end switch alsa_handler (spdif)
alsa_can_pause = snd_pcm_hw_params_can_pause(alsa_hwparams);
- return(1);
+ return 1;
} // end init
@@ -837,7 +837,7 @@ static int play(void* data, int len, int flags)
mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_TryingToResetSoundcard);
if ((res = snd_pcm_prepare(alsa_handler)) < 0) {
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmPrepareError, snd_strerror(res));
- return(0);
+ return 0;
break;
}
}
@@ -857,13 +857,13 @@ static int get_space(void)
if ((ret = snd_pcm_status(alsa_handler, status)) < 0)
{
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_CannotGetPcmStatus, snd_strerror(ret));
- return(0);
+ return 0;
}
ret = snd_pcm_status_get_avail(status) * bytes_per_sample;
if (ret > ao_data.buffersize) // Buffer underrun?
ret = ao_data.buffersize;
- return(ret);
+ return ret;
}
/* delay in seconds between first and last sample in buffer */
@@ -884,6 +884,6 @@ static float get_delay(void)
}
return (float)delay / (float)ao_data.samplerate;
} else {
- return(0);
+ return 0;
}
}
diff --git a/libao2/ao_alsa5.c b/libao2/ao_alsa5.c
index 84de03cfab..7bec0371e6 100644
--- a/libao2/ao_alsa5.c
+++ b/libao2/ao_alsa5.c
@@ -35,7 +35,7 @@ static int alsa_rate = SND_PCM_RATE_CONTINUOUS;
/* to set/get/query special features/parameters */
static int control(int cmd, void *arg)
{
- return(CONTROL_UNKNOWN);
+ return CONTROL_UNKNOWN;
}
/*
@@ -62,7 +62,7 @@ static int init(int rate_hz, int channels, int format, int flags)
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 @@ static int init(int rate_hz, int channels, int format, int flags)
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 @@ static int init(int rate_hz, int channels, int format, int flags)
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 @@ static int init(int rate_hz, int channels, int format, int flags)
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 @@ static int init(int rate_hz, int channels, int format, int flags)
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 @@ static int init(int rate_hz, int channels, int format, int flags)
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 @@ static int play(void* data, int len, int flags)
int got_len;
if (!len)
- return(0);
+ return 0;
if ((got_len = snd_pcm_write(alsa_handler, data, len)) < 0)
{
@@ -331,20 +331,20 @@ static int play(void* data, int len, int flags)
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 @@ static int get_space(void)
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 @@ static float get_delay(void)
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;
}
diff --git a/libao2/ao_arts.c b/libao2/ao_arts.c
index 96379560a0..092fe20dd4 100644
--- a/libao2/ao_arts.c
+++ b/libao2/ao_arts.c
@@ -37,7 +37,7 @@ LIBAO_EXTERN(arts)
static int control(int cmd, void *arg)
{
- return(CONTROL_UNKNOWN);
+ return CONTROL_UNKNOWN;
}
static int init(int rate_hz, int channels, int format, int flags)
diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c
index 3d460a9bfb..0437b39a24 100644
--- a/libao2/ao_sdl.c
+++ b/libao2/ao_sdl.c
@@ -231,7 +231,7 @@ void callback(void *userdata, Uint8 *stream, int len); userdata is the pointer s
/* Open the audio device and start playing sound! */
if(SDL_OpenAudio(&aspec, &obtained) < 0) {
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_SDL_CantOpenAudio, SDL_GetError());
- return(0);
+ return 0;
}
/* did we got what we wanted ? */