aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs/audioOutput_ao.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-24 07:20:36 +0200
committerMax Kellermann <max@duempel.org>2008-09-24 07:20:36 +0200
commit3cae6856b8c6096b3f932a4ab30476a8d1187e58 (patch)
treece4a7dfea71105b723779b08d37108ec3f258bdd /src/audioOutputs/audioOutput_ao.c
parentd32f49a90ba69525884ee6fe4f2055792aa10430 (diff)
downloadmpd-3cae6856b8c6096b3f932a4ab30476a8d1187e58.tar.gz
mpd-3cae6856b8c6096b3f932a4ab30476a8d1187e58.tar.xz
mpd-3cae6856b8c6096b3f932a4ab30476a8d1187e58.zip
output: pass audio_format to plugin.init() and plugin.open()
Pass the globally configured audio_format as a const pointer to plugin.init(). plugin.open() gets a writable pointer which contains the audio_format requested by the plugin. Its initial value is either the configured audio_format or the input file's audio_format.
Diffstat (limited to 'src/audioOutputs/audioOutput_ao.c')
-rw-r--r--src/audioOutputs/audioOutput_ao.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/audioOutputs/audioOutput_ao.c b/src/audioOutputs/audioOutput_ao.c
index 1aa57cba2..22a4cb96a 100644
--- a/src/audioOutputs/audioOutput_ao.c
+++ b/src/audioOutputs/audioOutput_ao.c
@@ -55,6 +55,7 @@ static void audioOutputAo_error(void)
}
static int audioOutputAo_initDriver(struct audio_output *audioOutput,
+ mpd_unused const struct audio_format *audio_format,
ConfigParam * param)
{
ao_info *ai;
@@ -174,7 +175,8 @@ static void audioOutputAo_closeDevice(struct audio_output *audioOutput)
audioOutput->open = 0;
}
-static int audioOutputAo_openDevice(struct audio_output *audioOutput)
+static int audioOutputAo_openDevice(struct audio_output *audioOutput,
+ struct audio_format *audio_format)
{
ao_sample_format format;
AoData *ad = (AoData *) audioOutput->data;
@@ -183,10 +185,10 @@ static int audioOutputAo_openDevice(struct audio_output *audioOutput)
audioOutputAo_closeDevice(audioOutput);
}
- format.bits = audioOutput->outAudioFormat.bits;
- format.rate = audioOutput->outAudioFormat.sampleRate;
+ format.bits = audio_format->bits;
+ format.rate = audio_format->sampleRate;
format.byte_format = AO_FMT_NATIVE;
- format.channels = audioOutput->outAudioFormat.channels;
+ format.channels = audio_format->channels;
ad->device = ao_open_live(ad->driverId, &format, ad->options);