aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/OpenALOutputPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-03 21:00:50 +0200
committerMax Kellermann <max@duempel.org>2013-08-03 21:37:56 +0200
commitd1e7b4e38136f9342aad76c685a13adf0e69f869 (patch)
tree49643b937ddfe735511b566a71398da5a945d7aa /src/output/OpenALOutputPlugin.cxx
parent67f591a9ce60651da41afc499bd9a22e25314e35 (diff)
downloadmpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.gz
mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.xz
mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.zip
audio_format: convert to C++
Diffstat (limited to 'src/output/OpenALOutputPlugin.cxx')
-rw-r--r--src/output/OpenALOutputPlugin.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/output/OpenALOutputPlugin.cxx b/src/output/OpenALOutputPlugin.cxx
index e68032d75..81c75f6c4 100644
--- a/src/output/OpenALOutputPlugin.cxx
+++ b/src/output/OpenALOutputPlugin.cxx
@@ -66,26 +66,26 @@ openal_output_quark(void)
}
static ALenum
-openal_audio_format(struct audio_format *audio_format)
+openal_audio_format(AudioFormat &audio_format)
{
- /* note: cannot map SAMPLE_FORMAT_S8 to AL_FORMAT_STEREO8 or
+ /* note: cannot map SampleFormat::S8 to AL_FORMAT_STEREO8 or
AL_FORMAT_MONO8 since OpenAL expects unsigned 8 bit
samples, while MPD uses signed samples */
- switch (audio_format->format) {
- case SAMPLE_FORMAT_S16:
- if (audio_format->channels == 2)
+ switch (audio_format.format) {
+ case SampleFormat::S16:
+ if (audio_format.channels == 2)
return AL_FORMAT_STEREO16;
- if (audio_format->channels == 1)
+ if (audio_format.channels == 1)
return AL_FORMAT_MONO16;
/* fall back to mono */
- audio_format->channels = 1;
+ audio_format.channels = 1;
return openal_audio_format(audio_format);
default:
/* fall back to 16 bit */
- audio_format->format = SAMPLE_FORMAT_S16;
+ audio_format.format = SampleFormat::S16;
return openal_audio_format(audio_format);
}
}
@@ -169,7 +169,7 @@ openal_finish(struct audio_output *ao)
}
static bool
-openal_open(struct audio_output *ao, struct audio_format *audio_format,
+openal_open(struct audio_output *ao, AudioFormat &audio_format,
GError **error)
{
OpenALOutput *od = (OpenALOutput *)ao;
@@ -199,7 +199,7 @@ openal_open(struct audio_output *ao, struct audio_format *audio_format,
}
od->filled = 0;
- od->frequency = audio_format->sample_rate;
+ od->frequency = audio_format.sample_rate;
return true;
}