aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/flac_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/flac_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 '')
-rw-r--r--src/inputPlugins/flac_plugin.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c
index 4bfc87246..f5d5469f7 100644
--- a/src/inputPlugins/flac_plugin.c
+++ b/src/inputPlugins/flac_plugin.c
@@ -242,7 +242,7 @@ static FLAC__StreamDecoderWriteStatus flacWrite(const flac_decoder *dec,
FLAC__uint32 samples = frame->header.blocksize;
unsigned int c_samp;
const unsigned int num_channels = frame->header.channels;
- const unsigned int bytes_per_sample = (dc.audioFormat.bits / 8);
+ const unsigned int bytes_per_sample = (data->audio_format.bits / 8);
const unsigned int bytes_per_channel =
bytes_per_sample * frame->header.channels;
const unsigned int max_samples = FLAC_CHUNK_SIZE / bytes_per_channel;
@@ -250,7 +250,7 @@ static FLAC__StreamDecoderWriteStatus flacWrite(const flac_decoder *dec,
float timeChange;
FLAC__uint64 newPosition = 0;
- assert(dc.audioFormat.bits > 0);
+ assert(data->audio_format.bits > 0);
timeChange = ((float)samples) / frame->header.sample_rate;
data->time += timeChange;
@@ -415,7 +415,7 @@ static int flac_decode_internal(struct decoder * decoder,
}
}
- decoder_initialized(decoder);
+ decoder_initialized(decoder, &data.audio_format);
while (1) {
if (!flac_process_single(flacDec))
@@ -424,11 +424,11 @@ static int flac_decode_internal(struct decoder * decoder,
break;
if (dc.command == DECODE_COMMAND_SEEK) {
FLAC__uint64 sampleToSeek = dc.seekWhere *
- dc.audioFormat.sampleRate + 0.5;
+ data.audio_format.sampleRate + 0.5;
if (flac_seek_absolute(flacDec, sampleToSeek)) {
decoder_clear(decoder);
data.time = ((float)sampleToSeek) /
- dc.audioFormat.sampleRate;
+ data.audio_format.sampleRate;
data.position = 0;
} else
dc.seekError = 1;