summaryrefslogtreecommitdiffstats
path: root/pulse
diff options
context:
space:
mode:
authorLennart Poettering <mznyfn@0pointer.de>2009-07-31 16:01:52 +0200
committerTakashi Iwai <tiwai@suse.de>2009-08-03 12:36:03 +0200
commitd2ea09f162f114480516a9d993d3d71bf357c835 (patch)
treeb0438d2cea70fd33e4d6b7a15c04cf56aeaf87ab /pulse
parentbe8799947bac41c50460111b0ac20ff8176b6b47 (diff)
pulse: use PA_CONTEXT_IS_GOOD where applicable
PA_CONTEXT_IS_GOOD is a safer way to check whether a context is still valid. This patch also bumps the version requirement of libpulse to 0.9.11. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'pulse')
-rw-r--r--pulse/pulse.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pulse/pulse.c b/pulse/pulse.c
index 95d8dde..dd17384 100644
--- a/pulse/pulse.c
+++ b/pulse/pulse.c
@@ -38,7 +38,7 @@ int pulse_check_connection(snd_pulse_t * p)
state = pa_context_get_state(p->context);
- if (state != PA_CONTEXT_READY)
+ if (!PA_CONTEXT_IS_GOOD(state))
return -EIO;
return 0;
@@ -127,8 +127,7 @@ int pulse_wait_stream_state(snd_pulse_t * p, pa_stream * stream,
if (state == target)
break;
- if (state == PA_STREAM_FAILED ||
- state == PA_STREAM_TERMINATED)
+ if (!PA_STREAM_IS_GOOD(state))
return -EIO;
pa_threaded_mainloop_wait(p->mainloop);