From 752dfb3d95482c562e5d24c6ea839c4815de9a6d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 14 Feb 2010 17:04:39 +0100 Subject: replay_gain: reimplement as a filter plugin Apply the replay gain in the output thread. This means a new setting will be active instantly, without going through the whole music pipe. And we might have different replay gain settings for each audio output device. --- src/decoder_internal.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/decoder_internal.c') diff --git a/src/decoder_internal.c b/src/decoder_internal.c index 7829b4d76..990d728e9 100644 --- a/src/decoder_internal.c +++ b/src/decoder_internal.c @@ -86,8 +86,15 @@ decoder_get_chunk(struct decoder *decoder, struct input_stream *is) do { decoder->chunk = music_buffer_allocate(dc->buffer); - if (decoder->chunk != NULL) + if (decoder->chunk != NULL) { + decoder->chunk->replay_gain_serial = + decoder->replay_gain_serial; + if (decoder->replay_gain_serial != 0) + decoder->chunk->replay_gain_info = + decoder->replay_gain_info; + return decoder->chunk; + } decoder_lock(dc); cmd = need_chunks(dc, is, true); -- cgit v1.2.3