aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-05 08:10:13 +0100
committerMax Kellermann <max@duempel.org>2008-11-05 08:10:13 +0100
commit5d6e96e986d54f4c2437b74a1ec12e92c399c24e (patch)
tree6410586e68518ce47cd77d07164662a3a125652b
parent3defcef5f3b4d0d0f928832bce012587abae3a16 (diff)
downloadmpd-5d6e96e986d54f4c2437b74a1ec12e92c399c24e.tar.gz
mpd-5d6e96e986d54f4c2437b74a1ec12e92c399c24e.tar.xz
mpd-5d6e96e986d54f4c2437b74a1ec12e92c399c24e.zip
pulse: removed reconnect interval
The output thread automatically waits some time before retrying to open the device. Don't duplicate this check in the pulse plugin.
-rw-r--r--src/output/pulse_plugin.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/output/pulse_plugin.c b/src/output/pulse_plugin.c
index 7d935c50a..5f9ba7d1b 100644
--- a/src/output/pulse_plugin.c
+++ b/src/output/pulse_plugin.c
@@ -23,7 +23,6 @@
#include <pulse/error.h>
#define MPD_PULSE_NAME "mpd"
-#define CONN_ATTEMPT_INTERVAL 60
struct pulse_data {
struct audio_output *ao;
@@ -31,8 +30,6 @@ struct pulse_data {
pa_simple *s;
char *server;
char *sink;
- int num_connect_attempts;
- time_t last_connect_attempt;
};
static struct pulse_data *pulse_new_data(void)
@@ -44,8 +41,6 @@ static struct pulse_data *pulse_new_data(void)
ret->s = NULL;
ret->server = NULL;
ret->sink = NULL;
- ret->num_connect_attempts = 0;
- ret->last_connect_attempt = 0;
return ret;
}
@@ -114,18 +109,8 @@ pulse_open(void *data, struct audio_format *audio_format)
{
struct pulse_data *pd = data;
pa_sample_spec ss;
- time_t t;
int error;
- t = time(NULL);
-
- if (pd->num_connect_attempts != 0 &&
- (t - pd->last_connect_attempt) < CONN_ATTEMPT_INTERVAL)
- return false;
-
- pd->num_connect_attempts++;
- pd->last_connect_attempt = t;
-
/* MPD doesn't support the other pulseaudio sample formats, so
we just force MPD to send us everything as 16 bit */
audio_format->bits = 16;
@@ -140,14 +125,12 @@ pulse_open(void *data, struct audio_format *audio_format)
&error);
if (!pd->s) {
g_warning("Cannot connect to server in PulseAudio output "
- "\"%s\" (attempt %i): %s\n",
+ "\"%s\": %s\n",
audio_output_get_name(pd->ao),
- pd->num_connect_attempts, pa_strerror(error));
+ pa_strerror(error));
return false;
}
- pd->num_connect_attempts = 0;
-
g_debug("PulseAudio output \"%s\" connected and playing %i bit, %i "
"channel audio at %i Hz\n",
audio_output_get_name(pd->ao),