alsa-plugins/0003-pulse-use-PA_CONTEXT_IS_GOOD-where-applicable.patch
2009-08-04 22:15:24 +00:00

42 lines
1.1 KiB
Diff

From d2ea09f162f114480516a9d993d3d71bf357c835 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <mznyfn@0pointer.de>
Date: Fri, 31 Jul 2009 16:01:52 +0200
Subject: [PATCH 03/11] 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>
---
pulse/pulse.c | 5 ++---
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);
--
1.6.4