From 4590a98f0eb9484e185e7e0c25a3373c8e9076ea Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Tue, 26 Aug 2008 08:27:05 +0200
Subject: added audio_format parameter to decoder_initialized()

dc->audioFormat is set once by the decoder plugins before invoking
decoder_initialized(); hide dc->audioFormat and let the decoder pass
an AudioFormat pointer to decoder_initialized().
---
 src/decoder_api.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/decoder_api.c')

diff --git a/src/decoder_api.c b/src/decoder_api.c
index 99f7293bb..9583c7493 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -24,10 +24,17 @@
 #include "playerData.h"
 #include "gcc.h"
 
-void decoder_initialized(mpd_unused struct decoder * decoder)
+void decoder_initialized(mpd_unused struct decoder * decoder,
+			 const AudioFormat * audio_format)
 {
 	assert(dc.state == DECODE_STATE_START);
 
+	if (audio_format != NULL) {
+		dc.audioFormat = *audio_format;
+		getOutputAudioFormat(audio_format,
+				     &(ob.audioFormat));
+	}
+
 	dc.state = DECODE_STATE_DECODE;
 	notify_signal(&pc.notify);
 }
-- 
cgit v1.2.3