From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sun, 3 Apr 2022 09:35:48 +0000 (+0100) Subject: Improve the logic for supressing clicks when the alsa disable_standby_mode is active. X-Git-Tag: 4.1-rc1~24^2~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a295c2a2910cd2105bd9265617eebf0cdefe6542;p=thirdparty%2Fshairport-sync.git Improve the logic for supressing clicks when the alsa disable_standby_mode is active. --- diff --git a/audio_alsa.c b/audio_alsa.c index 373b1db9..e019ea56 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -1923,15 +1923,13 @@ static void flush(void) { // debug(2,"audio_alsa flush called."); pthread_cleanup_debug_mutex_lock(&alsa_mutex, 10000, 1); if (alsa_backend_state != abm_disconnected) { // must be playing or connected... + // do nothing for a flush if config.keep_dac_busy is true if (config.keep_dac_busy == 0) { - // debug(1,"flush is actually a close"); - do_close(); - } else { - // debug(1,"flush is a real flush"); sub_flush(); } - } else + } else { debug(3, "alsa: flush() -- called on a disconnected alsa backend"); + } debug_mutex_unlock(&alsa_mutex, 3); pthread_cleanup_pop(0); // release the mutex }