Commit b21e8ad4 authored by Max Kellermann's avatar Max Kellermann

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.
parent e8aee4d9
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment