aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio.c
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/audio.c
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/audio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/audio.c b/src/audio.c
index 3d4cf1a48..45f36fff6 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -342,6 +342,7 @@ int enableAudioDevice(unsigned int device)
if (device >= audioOutputArraySize)
return -1;
+ audioOutputArray[device].reopen_after = 0;
audioOutputArray[device].enabled = true;
idle_add(IDLE_OUTPUT);