From b21e8ad4a5e5cf5bbfdb8cca49df852523fe53a4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Feb 2009 22:15:42 +0100 Subject: output_all: immediately reopen output on play When MPD explicitly starts playing, ignore the "REOPEN_AFTER" timeout. This timeout was useful when MPD attempted to reopen a failed device over and over, but it confuses users when they explicitly tell MPD to start playing, while MPD insists to wait for the 10 seconds to pass. --- src/output_all.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/output_all.c') diff --git a/src/output_all.c b/src/output_all.c index 166dbb430..fa2d741c2 100644 --- a/src/output_all.c +++ b/src/output_all.c @@ -149,6 +149,18 @@ static void audio_output_wait_all(void) notify_wait(&audio_output_client_notify); } +/** + * Resets the "reopen" flag on all audio devices. MPD should + * immediately retry to open the device instead of waiting for the + * timeout when the user wants to start playback. + */ +static void +audio_output_all_reset_reopen(void) +{ + for (unsigned i = 0; i < num_audio_outputs; ++i) + audio_outputs[i].reopen_after = 0; +} + static void audio_output_all_update(void) { @@ -216,6 +228,7 @@ audio_output_all_open(const struct audio_format *audio_format) if (audio_format != NULL) input_audio_format = *audio_format; + audio_output_all_reset_reopen(); audio_output_all_update(); for (i = 0; i < num_audio_outputs; ++i) { -- cgit v1.2.3