aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_internal.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-29 22:32:50 +0100
committerMax Kellermann <max@duempel.org>2008-10-29 22:32:50 +0100
commit7da0e005f34bd8ce305b8ece7a33a8405bbaba87 (patch)
treef363b239548d64895fcd0a5603fca951d4738eec /src/output_internal.h
parent0eae1c55adefc3e7509b2ef40f4da8baa3fe24ef (diff)
downloadmpd-7da0e005f34bd8ce305b8ece7a33a8405bbaba87.tar.gz
mpd-7da0e005f34bd8ce305b8ece7a33a8405bbaba87.tar.xz
mpd-7da0e005f34bd8ce305b8ece7a33a8405bbaba87.zip
output: delay reopen after device failure
When one of several output devices failed, MPD tried to reopen it quite often, wasting a lot of resources. This patch adds a delay: wait 10 seconds before retrying. This might be changed to exponential delays later, but for now, it makes the problem go away.
Diffstat (limited to '')
-rw-r--r--src/output_internal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/output_internal.h b/src/output_internal.h
index 0fae6f304..cfa231210 100644
--- a/src/output_internal.h
+++ b/src/output_internal.h
@@ -23,6 +23,8 @@
#include "pcm_utils.h"
#include "notify.h"
+#include <time.h>
+
struct audio_output {
/**
* The device's configured display name.
@@ -51,6 +53,12 @@ struct audio_output {
bool open;
/**
+ * If not zero, the device has failed, and should not be
+ * reopened automatically before this time stamp.
+ */
+ time_t reopen_after;
+
+ /**
* The audio_format in which audio data is received from the
* player thread (which in turn receives it from the decoder).
*/