Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lennart Poettering <mznyfn@0pointer.de>
To: ALSA Development Mailing List <alsa-devel@alsa-project.org>
Subject: [PATCH 2/4] pulse: use PA_CONTEXT_IS_GOOD where applicable
Date: Fri, 31 Jul 2009 16:01:52 +0200	[thread overview]
Message-ID: <20090731140152.GA31185@omega> (raw)

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.
---
 configure.in  |    2 +-
 pulse/pulse.c |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/configure.in b/configure.in
index 36740e9..f8bc669 100644
--- a/configure.in
+++ b/configure.in
@@ -30,7 +30,7 @@ AC_ARG_ENABLE([pulseaudio],
       AS_HELP_STRING([--disable-pulseaudio], [Disable building of pulseaudio plugin]))
 
 if test "x$enable_pulseaudio" != "xno"; then
-  PKG_CHECK_MODULES(pulseaudio, [libpulse >= 0.9.2], [HAVE_PULSE=yes], [HAVE_PULSE=no])
+  PKG_CHECK_MODULES(pulseaudio, [libpulse >= 0.9.11], [HAVE_PULSE=yes], [HAVE_PULSE=no])
 fi
 AM_CONDITIONAL(HAVE_PULSE, test x$HAVE_PULSE = xyes)
 
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.3.3



Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

                 reply	other threads:[~2009-07-31 14:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090731140152.GA31185@omega \
    --to=mznyfn@0pointer.de \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox