From 96493e0333404ddea739a08e1e3ead8dcb6f836c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 16 Feb 2010 08:55:37 +0100 Subject: replay_gain: optionally use hardware mixer to apply replay gain Add an option for each audio output which enables the use of the hardware mixer, instead of the software volume code. This is hardware specific, and assumes linear volume control. This is not the case for hardware mixers which were tested, making this patch somewhat useless, but we will use it to experiment with the settings, to find a good solution. --- src/output_thread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/output_thread.c') diff --git a/src/output_thread.c b/src/output_thread.c index 0e34c64b7..4bf0827f6 100644 --- a/src/output_thread.c +++ b/src/output_thread.c @@ -264,7 +264,8 @@ ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk) /* update replay gain */ - if (chunk->replay_gain_serial != ao->replay_gain_serial) { + if (ao->replay_gain_filter != NULL && + 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 -- cgit v1.2.3