diff options
author | Max Kellermann <max@duempel.org> | 2008-11-02 16:55:43 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-02 16:55:43 +0100 |
commit | 8b1f6ff3c8ed06ef469d29b4a691dc4776a3db82 (patch) | |
tree | 1f54932ea014cf5ef97b2c298e2051bbd4fbb22e /src/decoder_api.c | |
parent | 30fca5e5a9c26bf73a24ae5710f8d9d21be49011 (diff) | |
download | mpd-8b1f6ff3c8ed06ef469d29b4a691dc4776a3db82.tar.gz mpd-8b1f6ff3c8ed06ef469d29b4a691dc4776a3db82.tar.xz mpd-8b1f6ff3c8ed06ef469d29b4a691dc4776a3db82.zip |
decoder: replaced music_pipe.audioFormat with dc.out_audio_format
.. and rename dc.audioFormat to dc.in_audio_format. The music pipe
does not need to know the audio format, and its former "audioFormat"
property indicated the format of the most recently added chunk, which
might be confusing when you are reading the oldest chunks.
Diffstat (limited to '')
-rw-r--r-- | src/decoder_api.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c index 715a46c8d..73b5d23f6 100644 --- a/src/decoder_api.c +++ b/src/decoder_api.c @@ -39,8 +39,8 @@ void decoder_initialized(struct decoder * decoder, pcm_convert_init(&decoder->conv_state); - dc.audioFormat = *audio_format; - getOutputAudioFormat(audio_format, &ob.audioFormat); + dc.in_audio_format = *audio_format; + getOutputAudioFormat(audio_format, &dc.out_audio_format); dc.totalTime = total_time; @@ -157,12 +157,12 @@ decoder_data(struct decoder *decoder, static char *convBuffer; static size_t convBufferLen; - if (audio_format_equals(&ob.audioFormat, &dc.audioFormat)) { + if (audio_format_equals(&dc.in_audio_format, &dc.out_audio_format)) { data = dataIn; datalen = dataInLen; } else { - datalen = pcm_convert_size(&(dc.audioFormat), dataInLen, - &(ob.audioFormat)); + datalen = pcm_convert_size(&dc.in_audio_format, dataInLen, + &dc.out_audio_format); if (datalen > convBufferLen) { if (convBuffer != NULL) free(convBuffer); @@ -170,18 +170,21 @@ decoder_data(struct decoder *decoder, convBufferLen = datalen; } data = convBuffer; - datalen = pcm_convert(&(dc.audioFormat), dataIn, - dataInLen, &(ob.audioFormat), + datalen = pcm_convert(&dc.in_audio_format, dataIn, + dataInLen, &dc.out_audio_format, data, &decoder->conv_state); } if (replayGainInfo != NULL && (replayGainState != REPLAYGAIN_OFF)) - doReplayGain(replayGainInfo, data, datalen, &ob.audioFormat); + doReplayGain(replayGainInfo, data, datalen, + &dc.out_audio_format); else if (normalizationEnabled) - normalizeData(data, datalen, &ob.audioFormat); + normalizeData(data, datalen, &dc.out_audio_format); while (datalen > 0) { - nbytes = music_pipe_append(data, datalen, data_time, bitRate); + nbytes = music_pipe_append(data, datalen, + &dc.out_audio_format, + data_time, bitRate); datalen -= nbytes; data += nbytes; |