aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-10 14:40:54 +0200
committerMax Kellermann <max@duempel.org>2008-10-10 14:40:54 +0200
commitde2cb3f37568e7680549057f8d7b6d748c388480 (patch)
tree46f9f43a1f83b49945c8a4fc77f933fad9230e01 /src/audioOutputs
parent6101dc6c768b09dbcdc1840a84b619a5a6a20129 (diff)
downloadmpd-de2cb3f37568e7680549057f8d7b6d748c388480.tar.gz
mpd-de2cb3f37568e7680549057f8d7b6d748c388480.tar.xz
mpd-de2cb3f37568e7680549057f8d7b6d748c388480.zip
audio_format: renamed sampleRate to sample_rate
The last bit of CamelCase in audio_format.h. Additionally, rename a bunch of local variables.
Diffstat (limited to 'src/audioOutputs')
-rw-r--r--src/audioOutputs/audioOutput_alsa.c16
-rw-r--r--src/audioOutputs/audioOutput_ao.c2
-rw-r--r--src/audioOutputs/audioOutput_jack.c8
-rw-r--r--src/audioOutputs/audioOutput_mvp.c8
-rw-r--r--src/audioOutputs/audioOutput_oss.c4
-rw-r--r--src/audioOutputs/audioOutput_osx.c4
-rw-r--r--src/audioOutputs/audioOutput_pulse.c4
-rw-r--r--src/audioOutputs/audioOutput_shout.c2
-rw-r--r--src/audioOutputs/audioOutput_shout_mp3.c2
-rw-r--r--src/audioOutputs/audioOutput_shout_ogg.c4
10 files changed, 27 insertions, 27 deletions
diff --git a/src/audioOutputs/audioOutput_alsa.c b/src/audioOutputs/audioOutput_alsa.c
index 83bd9c256..30ad449f3 100644
--- a/src/audioOutputs/audioOutput_alsa.c
+++ b/src/audioOutputs/audioOutput_alsa.c
@@ -142,7 +142,7 @@ static int alsa_openDevice(void *data, struct audio_format *audioFormat)
snd_pcm_format_t bitformat;
snd_pcm_hw_params_t *hwparams;
snd_pcm_sw_params_t *swparams;
- unsigned int sampleRate = audioFormat->sampleRate;
+ unsigned int sample_rate = audioFormat->sample_rate;
unsigned int channels = audioFormat->channels;
snd_pcm_uframes_t alsa_buffer_size;
snd_pcm_uframes_t alsa_period_size;
@@ -217,13 +217,13 @@ configure_hw:
audioFormat->channels = (int8_t)channels;
err = snd_pcm_hw_params_set_rate_near(ad->pcmHandle, hwparams,
- &sampleRate, NULL);
- if (err < 0 || sampleRate == 0) {
- ERROR("ALSA device \"%s\" does not support %i Hz audio\n",
- ad->device, (int)audioFormat->sampleRate);
+ &sample_rate, NULL);
+ if (err < 0 || sample_rate == 0) {
+ ERROR("ALSA device \"%s\" does not support %u Hz audio\n",
+ ad->device, audioFormat->sample_rate);
goto fail;
}
- audioFormat->sampleRate = sampleRate;
+ audioFormat->sample_rate = sample_rate;
buffer_time = ad->buffer_time;
cmd = "snd_pcm_hw_params_set_buffer_time_near";
@@ -291,8 +291,8 @@ configure_hw:
ad->sampleSize = audio_format_sample_size(audioFormat) * audioFormat->channels;
DEBUG("ALSA device \"%s\" will be playing %i bit, %u channel audio at "
- "%i Hz\n", ad->device, audioFormat->bits,
- channels, sampleRate);
+ "%u Hz\n", ad->device, audioFormat->bits,
+ channels, sample_rate);
return 0;
diff --git a/src/audioOutputs/audioOutput_ao.c b/src/audioOutputs/audioOutput_ao.c
index b91895bde..e731f972a 100644
--- a/src/audioOutputs/audioOutput_ao.c
+++ b/src/audioOutputs/audioOutput_ao.c
@@ -182,7 +182,7 @@ static int audioOutputAo_openDevice(void *data,
}
format.bits = audio_format->bits;
- format.rate = audio_format->sampleRate;
+ format.rate = audio_format->sample_rate;
format.byte_format = AO_FMT_NATIVE;
format.channels = audio_format->channels;
diff --git a/src/audioOutputs/audioOutput_jack.c b/src/audioOutputs/audioOutput_jack.c
index f26dfcf7a..8a2cb6cdc 100644
--- a/src/audioOutputs/audioOutput_jack.c
+++ b/src/audioOutputs/audioOutput_jack.c
@@ -126,7 +126,7 @@ static int srate(mpd_unused jack_nframes_t rate, void *data)
JackData *jd = (JackData *)data;
struct audio_format *audioFormat = jd->audio_format;
- audioFormat->sampleRate = (int)jack_get_sample_rate(jd->client);
+ audioFormat->sample_rate = (int)jack_get_sample_rate(jd->client);
return 0;
}
@@ -188,13 +188,13 @@ static void shutdown_callback(void *arg)
static void set_audioformat(JackData *jd, struct audio_format *audioFormat)
{
- audioFormat->sampleRate = (int) jack_get_sample_rate(jd->client);
- DEBUG("samplerate = %d\n", audioFormat->sampleRate);
+ audioFormat->sample_rate = jack_get_sample_rate(jd->client);
+ DEBUG("samplerate = %u\n", audioFormat->sample_rate);
audioFormat->channels = 2;
audioFormat->bits = 16;
jd->bps = audioFormat->channels
* sizeof(jack_default_audio_sample_t)
- * audioFormat->sampleRate;
+ * audioFormat->sample_rate;
}
static void error_callback(const char *msg)
diff --git a/src/audioOutputs/audioOutput_mvp.c b/src/audioOutputs/audioOutput_mvp.c
index 59f43a4fd..00b069c3d 100644
--- a/src/audioOutputs/audioOutput_mvp.c
+++ b/src/audioOutputs/audioOutput_mvp.c
@@ -202,11 +202,11 @@ static int mvp_openDevice(struct audio_output *audioOutput,
return -1;
}
#ifdef WORDS_BIGENDIAN
- mvp_setPcmParams(md, audioFormat->sampleRate, audioFormat->channels, 0,
- audioFormat->bits);
+ mvp_setPcmParams(md, audioFormat->sample_rate, audioFormat->channels,
+ 0, audioFormat->bits);
#else
- mvp_setPcmParams(md, audioFormat->sampleRate, audioFormat->channels, 1,
- audioFormat->bits);
+ mvp_setPcmParams(md, audioFormat->sample_rate, audioFormat->channels,
+ 1, audioFormat->bits);
#endif
return 0;
}
diff --git a/src/audioOutputs/audioOutput_oss.c b/src/audioOutputs/audioOutput_oss.c
index 487e9a75d..8dddf3be7 100644
--- a/src/audioOutputs/audioOutput_oss.c
+++ b/src/audioOutputs/audioOutput_oss.c
@@ -487,14 +487,14 @@ static int oss_openDevice(void *data,
OssData *od = data;
od->channels = (int8_t)audioFormat->channels;
- od->sampleRate = audioFormat->sampleRate;
+ od->sampleRate = audioFormat->sample_rate;
od->bits = (int8_t)audioFormat->bits;
if ((ret = oss_open(od)) < 0)
return ret;
audioFormat->channels = od->channels;
- audioFormat->sampleRate = od->sampleRate;
+ audioFormat->sample_rate = od->sampleRate;
audioFormat->bits = od->bits;
DEBUG("oss device \"%s\" will be playing %i bit %i channel audio at "
diff --git a/src/audioOutputs/audioOutput_osx.c b/src/audioOutputs/audioOutput_osx.c
index 9071ed6c9..1fc0a5d9e 100644
--- a/src/audioOutputs/audioOutput_osx.c
+++ b/src/audioOutputs/audioOutput_osx.c
@@ -259,7 +259,7 @@ static int osx_openDevice(struct audio_output *audioOutput,
return -1;
}
- streamDesc.mSampleRate = audioFormat->sampleRate;
+ streamDesc.mSampleRate = audioFormat->sample_rate;
streamDesc.mFormatID = kAudioFormatLinearPCM;
streamDesc.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
#ifdef WORDS_BIGENDIAN
@@ -283,7 +283,7 @@ static int osx_openDevice(struct audio_output *audioOutput,
}
/* create a buffer of 1s */
- od->bufferSize = (audioFormat->sampleRate) *
+ od->bufferSize = (audioFormat->sample_rate) *
(audioFormat->bits >> 3) * (audioFormat->channels);
od->buffer = xrealloc(od->buffer, od->bufferSize);
diff --git a/src/audioOutputs/audioOutput_pulse.c b/src/audioOutputs/audioOutput_pulse.c
index 38014c8f0..93a1d8b37 100644
--- a/src/audioOutputs/audioOutput_pulse.c
+++ b/src/audioOutputs/audioOutput_pulse.c
@@ -138,7 +138,7 @@ static int pulse_openDevice(void *data,
}
ss.format = PA_SAMPLE_S16NE;
- ss.rate = audioFormat->sampleRate;
+ ss.rate = audioFormat->sample_rate;
ss.channels = audioFormat->channels;
pd->s = pa_simple_new(pd->server, MPD_PULSE_NAME, PA_STREAM_PLAYBACK,
@@ -159,7 +159,7 @@ static int pulse_openDevice(void *data,
"channel audio at %i Hz\n",
audio_output_get_name(pd->ao),
audioFormat->bits,
- audioFormat->channels, audioFormat->sampleRate);
+ audioFormat->channels, audioFormat->sample_rate);
return 0;
}
diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c
index 34327573c..00c4eb059 100644
--- a/src/audioOutputs/audioOutput_shout.c
+++ b/src/audioOutputs/audioOutput_shout.c
@@ -255,7 +255,7 @@ static void *my_shout_init_driver(struct audio_output *audio_output,
snprintf(temp, sizeof(temp), "%u", sd->audio_format.channels);
shout_set_audio_info(sd->shout_conn, SHOUT_AI_CHANNELS, temp);
- snprintf(temp, sizeof(temp), "%d", sd->audio_format.sampleRate);
+ snprintf(temp, sizeof(temp), "%u", sd->audio_format.sample_rate);
shout_set_audio_info(sd->shout_conn, SHOUT_AI_SAMPLERATE, temp);
diff --git a/src/audioOutputs/audioOutput_shout_mp3.c b/src/audioOutputs/audioOutput_shout_mp3.c
index c54632b15..722079b29 100644
--- a/src/audioOutputs/audioOutput_shout_mp3.c
+++ b/src/audioOutputs/audioOutput_shout_mp3.c
@@ -93,7 +93,7 @@ static int shout_mp3_encoder_init_encoder(struct shout_data *sd)
}
if (0 != lame_set_in_samplerate(ld->gfp,
- sd->audio_format.sampleRate)) {
+ sd->audio_format.sample_rate)) {
ERROR("error setting lame sample rate\n");
return -1;
}
diff --git a/src/audioOutputs/audioOutput_shout_ogg.c b/src/audioOutputs/audioOutput_shout_ogg.c
index 14747c324..5983b4d89 100644
--- a/src/audioOutputs/audioOutput_shout_ogg.c
+++ b/src/audioOutputs/audioOutput_shout_ogg.c
@@ -187,7 +187,7 @@ static int reinit_encoder(struct shout_data *sd)
if (sd->quality >= -1.0) {
if (0 != vorbis_encode_init_vbr(&od->vi,
sd->audio_format.channels,
- sd->audio_format.sampleRate,
+ sd->audio_format.sample_rate,
sd->quality * 0.1)) {
ERROR("error initializing vorbis vbr\n");
vorbis_info_clear(&od->vi);
@@ -196,7 +196,7 @@ static int reinit_encoder(struct shout_data *sd)
} else {
if (0 != vorbis_encode_init(&od->vi,
sd->audio_format.channels,
- sd->audio_format.sampleRate, -1.0,
+ sd->audio_format.sample_rate, -1.0,
sd->bitrate * 1000, -1.0)) {
ERROR("error initializing vorbis encoder\n");
vorbis_info_clear(&od->vi);