From 4590a98f0eb9484e185e7e0c25a3373c8e9076ea Mon Sep 17 00:00:00 2001 From: Max Kellermann 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/inputPlugins/oggflac_plugin.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/inputPlugins/oggflac_plugin.c') diff --git a/src/inputPlugins/oggflac_plugin.c b/src/inputPlugins/oggflac_plugin.c index b5e73e455..5879b7054 100644 --- a/src/inputPlugins/oggflac_plugin.c +++ b/src/inputPlugins/oggflac_plugin.c @@ -188,7 +188,7 @@ static FLAC__StreamDecoderWriteStatus oggflacWrite(const c_chan++) { u16 = buf[c_chan][c_samp]; uc = (unsigned char *)&u16; - for (i = 0; i < (dc.audioFormat.bits / 8); i++) { + for (i = 0; i < (data->audio_format.bits / 8); i++) { if (data->chunk_length >= FLAC_CHUNK_SIZE) { if (flacSendChunk(data) < 0) { return @@ -345,7 +345,7 @@ static int oggflac_decode(struct decoder * mpd_decoder, InputStream * inStream) goto fail; } - decoder_initialized(mpd_decoder); + decoder_initialized(mpd_decoder, &data.audio_format); while (1) { OggFLAC__seekable_stream_decoder_process_single(decoder); @@ -353,14 +353,14 @@ static int oggflac_decode(struct decoder * mpd_decoder, InputStream * inStream) OggFLAC__SEEKABLE_STREAM_DECODER_OK) { break; } - if (dc.command == DECODE_COMMAND_SEEK) { - FLAC__uint64 sampleToSeek = dc.seekWhere * - dc.audioFormat.sampleRate + 0.5; + if (dc->command == DECODE_COMMAND_SEEK) { + FLAC__uint64 sampleToSeek = dc->seekWhere * + data.audio_format.sampleRate + 0.5; if (OggFLAC__seekable_stream_decoder_seek_absolute (decoder, sampleToSeek)) { decoder_clear(mpd_decoder); data.time = ((float)sampleToSeek) / - dc.audioFormat.sampleRate; + data.audio_format.sampleRate; data.position = 0; } else dc.seekError = 1; -- cgit v1.2.3