aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-10 22:15:42 +0100
committerMax Kellermann <max@duempel.org>2009-02-10 22:15:42 +0100
commitb21e8ad4a5e5cf5bbfdb8cca49df852523fe53a4 (patch)
tree303ddefae0348c50a0e510d25d08a921883975f1
parente8aee4d992004e21e3862417e9ce0d1421073bb2 (diff)
downloadmpd-b21e8ad4a5e5cf5bbfdb8cca49df852523fe53a4.tar.gz
mpd-b21e8ad4a5e5cf5bbfdb8cca49df852523fe53a4.tar.xz
mpd-b21e8ad4a5e5cf5bbfdb8cca49df852523fe53a4.zip
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.
-rw-r--r--src/output_all.c13
1 files changed, 13 insertions, 0 deletions
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) {