diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:05 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:05 +0200 |
commit | 4590a98f0eb9484e185e7e0c25a3373c8e9076ea (patch) | |
tree | 94ea0d53bdf0b7f9b81ff679b0fb4466d971b1e5 /src/inputPlugins/oggflac_plugin.c | |
parent | 0d45870cea6836cd48e6953f4e67756b2502e22c (diff) | |
download | mpd-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/oggflac_plugin.c')
-rw-r--r-- | src/inputPlugins/oggflac_plugin.c | 12 |
1 files changed, 6 insertions, 6 deletions
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; |