aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/oggvorbis_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:05 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:05 +0200
commit4590a98f0eb9484e185e7e0c25a3373c8e9076ea (patch)
tree94ea0d53bdf0b7f9b81ff679b0fb4466d971b1e5 /src/inputPlugins/oggvorbis_plugin.c
parent0d45870cea6836cd48e6953f4e67756b2502e22c (diff)
downloadmpd-4590a98f0eb9484e185e7e0c25a3373c8e9076ea.tar.gz
mpd-4590a98f0eb9484e185e7e0c25a3373c8e9076ea.tar.xz
mpd-4590a98f0eb9484e185e7e0c25a3373c8e9076ea.zip
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().
Diffstat (limited to 'src/inputPlugins/oggvorbis_plugin.c')
-rw-r--r--src/inputPlugins/oggvorbis_plugin.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/inputPlugins/oggvorbis_plugin.c b/src/inputPlugins/oggvorbis_plugin.c
index 9e1cf89c0..2fb0a9e52 100644
--- a/src/inputPlugins/oggvorbis_plugin.c
+++ b/src/inputPlugins/oggvorbis_plugin.c
@@ -215,6 +215,7 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
OggVorbis_File vf;
ov_callbacks callbacks;
OggCallbackData data;
+ AudioFormat audio_format;
int current_section;
int prev_section = -1;
long ret;
@@ -264,7 +265,7 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
dc.totalTime = ov_time_total(&vf, -1);
if (dc.totalTime < 0)
dc.totalTime = 0;
- dc.audioFormat.bits = 16;
+ audio_format.bits = 16;
while (1) {
if (dc.command == DECODE_COMMAND_SEEK) {
@@ -281,12 +282,10 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
if (current_section != prev_section) {
/*printf("new song!\n"); */
vorbis_info *vi = ov_info(&vf, -1);
- dc.audioFormat.channels = vi->channels;
- dc.audioFormat.sampleRate = vi->rate;
+ audio_format.channels = vi->channels;
+ audio_format.sampleRate = vi->rate;
if (dc.state == DECODE_STATE_START) {
- getOutputAudioFormat(&(dc.audioFormat),
- &(ob.audioFormat));
- decoder_initialized(decoder);
+ decoder_initialized(decoder, &audio_format);
}
comments = ov_comment(&vf, -1)->user_comments;
putOggCommentsIntoOutputBuffer(inStream->metaName,
@@ -312,7 +311,7 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
decoder_data(decoder, inStream,
inStream->seekable,
chunk, chunkpos,
- ov_pcm_tell(&vf) / dc.audioFormat.sampleRate,
+ ov_pcm_tell(&vf) / audio_format.sampleRate,
bitRate, replayGainInfo);
chunkpos = 0;
if (dc.command == DECODE_COMMAND_STOP)