c6ba4aa
From d2ea09f162f114480516a9d993d3d71bf357c835 Mon Sep 17 00:00:00 2001
c6ba4aa
From: Lennart Poettering <mznyfn@0pointer.de>
c6ba4aa
Date: Fri, 31 Jul 2009 16:01:52 +0200
c6ba4aa
Subject: [PATCH 03/11] pulse: use PA_CONTEXT_IS_GOOD where applicable
1ae1f5d
1ae1f5d
PA_CONTEXT_IS_GOOD is a safer way to check whether a context is still
1ae1f5d
valid.
1ae1f5d
1ae1f5d
This patch also bumps the version requirement of libpulse to 0.9.11.
c6ba4aa
c6ba4aa
Signed-off-by: Takashi Iwai <tiwai@suse.de>
1ae1f5d
---
1ae1f5d
 pulse/pulse.c |    5 ++---
c6ba4aa
 1 files changed, 2 insertions(+), 3 deletions(-)
1ae1f5d
1ae1f5d
diff --git a/pulse/pulse.c b/pulse/pulse.c
1ae1f5d
index 95d8dde..dd17384 100644
1ae1f5d
--- a/pulse/pulse.c
1ae1f5d
+++ b/pulse/pulse.c
1ae1f5d
@@ -38,7 +38,7 @@ int pulse_check_connection(snd_pulse_t * p)
1ae1f5d
 
1ae1f5d
 	state = pa_context_get_state(p->context);
1ae1f5d
 
1ae1f5d
-	if (state != PA_CONTEXT_READY)
1ae1f5d
+	if (!PA_CONTEXT_IS_GOOD(state))
1ae1f5d
 		return -EIO;
1ae1f5d
 
1ae1f5d
 	return 0;
1ae1f5d
@@ -127,8 +127,7 @@ int pulse_wait_stream_state(snd_pulse_t * p, pa_stream * stream,
1ae1f5d
 		if (state == target)
1ae1f5d
 			break;
1ae1f5d
 
1ae1f5d
-		if (state == PA_STREAM_FAILED ||
1ae1f5d
-		    state == PA_STREAM_TERMINATED)
1ae1f5d
+		if (!PA_STREAM_IS_GOOD(state))
1ae1f5d
 			return -EIO;
1ae1f5d
 
1ae1f5d
 		pa_threaded_mainloop_wait(p->mainloop);
1ae1f5d
-- 
c6ba4aa
1.6.4
1ae1f5d