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_thread.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/decoder_thread.c') diff --git a/src/decoder_thread.c b/src/decoder_thread.c index de095216a..f793fd032 100644 --- a/src/decoder_thread.c +++ b/src/decoder_thread.c @@ -31,6 +31,7 @@ #include "mapper.h" #include "path.h" #include "uri.h" +#include "replay_gain.h" #include @@ -302,6 +303,7 @@ decoder_run_song(struct decoder_control *dc, { struct decoder decoder = { .dc = dc, + .replay_gain = NULL, }; int ret; @@ -329,6 +331,9 @@ decoder_run_song(struct decoder_control *dc, pcm_convert_deinit(&decoder.conv_state); /* flush the last chunk */ + if (decoder.replay_gain != NULL) + replay_gain_info_free(decoder.replay_gain); + if (decoder.chunk != NULL) decoder_flush_chunk(&decoder); -- cgit v1.2.3