From cd8f92c9285e9b3b460ff47d2f251bfabce544da Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 3 Jan 2010 22:44:23 +0100 Subject: decoder_api: added function decoder_replay_gain() This function replaces the replay_gain_info parameter for decoder_data(). This allows the decoder to announce replay gain changes, instead of having to pass the same object over and over. --- src/decoder/mpcdec_plugin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/decoder/mpcdec_plugin.c') diff --git a/src/decoder/mpcdec_plugin.c b/src/decoder/mpcdec_plugin.c index 2d6979a78..92f0cad84 100644 --- a/src/decoder/mpcdec_plugin.c +++ b/src/decoder/mpcdec_plugin.c @@ -210,6 +210,8 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is) replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak = info.peak_album / 32767.0; replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain = info.gain_title * 0.01; replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak = info.peak_title / 32767.0; + decoder_replay_gain(mpd_decoder, replay_gain_info); + replay_gain_info_free(replay_gain_info); decoder_initialized(mpd_decoder, &audio_format, is->seekable, @@ -264,11 +266,9 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is) cmd = decoder_data(mpd_decoder, is, chunk, ret * sizeof(chunk[0]), - bit_rate, replay_gain_info); + bit_rate); } while (cmd != DECODE_COMMAND_STOP); - replay_gain_info_free(replay_gain_info); - #ifndef MPC_IS_OLD_API mpc_demux_exit(demux); #endif -- cgit v1.2.3