summaryrefslogtreecommitdiffstats
path: root/pulse/pulse.c
diff options
context:
space:
mode:
Diffstat (limited to 'pulse/pulse.c')
-rw-r--r--pulse/pulse.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/pulse/pulse.c b/pulse/pulse.c
index c313182..9c05171 100644
--- a/pulse/pulse.c
+++ b/pulse/pulse.c
@@ -59,12 +59,6 @@ int pulse_wait_operation(snd_pulse_t * p, pa_operation * o)
assert(p);
assert(o);
- if (p->state != PULSE_STATE_READY)
- return -EBADFD;
-
- if (!p->mainloop)
- return -EBADFD;
-
for (;;) {
int err;
@@ -124,8 +118,6 @@ snd_pulse_t *pulse_new(void)
if (!p)
return NULL;
- p->state = PULSE_STATE_INIT;
-
if (pipe(fd)) {
free(p);
return NULL;
@@ -192,13 +184,15 @@ void pulse_free(snd_pulse_t * p)
int pulse_connect(snd_pulse_t * p, const char *server)
{
int err;
+ pa_context_state_t state;
assert(p);
if (!p->context || !p->mainloop)
return -EBADFD;
- if (p->state != PULSE_STATE_INIT)
+ state = pa_context_get_state(p->context);
+ if (state != PA_CONTEXT_UNCONNECTED)
return -EBADFD;
pa_threaded_mainloop_lock(p->mainloop);
@@ -221,8 +215,6 @@ int pulse_connect(snd_pulse_t * p, const char *server)
pa_threaded_mainloop_unlock(p->mainloop);
- p->state = PULSE_STATE_READY;
-
return 0;
error: