aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-02-14 17:04:39 +0100
committerMax Kellermann <max@duempel.org>2010-02-17 07:23:13 +0100
commit752dfb3d95482c562e5d24c6ea839c4815de9a6d (patch)
tree46b62f26c4c68ebe81b72b9ca30366ffa14af1a5 /src/output_thread.c
parent5e0117b4441f257fcb1aab48b42a787567ebcbe6 (diff)
downloadmpd-752dfb3d95482c562e5d24c6ea839c4815de9a6d.tar.gz
mpd-752dfb3d95482c562e5d24c6ea839c4815de9a6d.tar.xz
mpd-752dfb3d95482c562e5d24c6ea839c4815de9a6d.zip
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.
Diffstat (limited to 'src/output_thread.c')
-rw-r--r--src/output_thread.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/output_thread.c b/src/output_thread.c
index eb44d4c87..0e34c64b7 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -26,6 +26,7 @@
#include "player_control.h"
#include "filter_plugin.h"
#include "filter/convert_filter_plugin.h"
+#include "filter/replay_gain_filter_plugin.h"
#include <glib.h>
@@ -261,6 +262,16 @@ ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk)
g_mutex_lock(ao->mutex);
}
+ /* update replay gain */
+
+ if (chunk->replay_gain_serial != ao->replay_gain_serial) {
+ replay_gain_filter_set_info(ao->replay_gain_filter,
+ chunk->replay_gain_serial != 0
+ ? &chunk->replay_gain_info
+ : NULL);
+ ao->replay_gain_serial = chunk->replay_gain_serial;
+ }
+
if (size == 0)
return true;