]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
pulse: use PA_CONTEXT_IS_GOOD where applicable
authorLennart Poettering <mznyfn@0pointer.de>
Fri, 31 Jul 2009 14:01:52 +0000 (16:01 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 3 Aug 2009 10:36:03 +0000 (12:36 +0200)
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>
configure.in
pulse/pulse.c

index 36740e959da0e69f4fab9c9d35935a9d64cc8d8b..f8bc669dd10a7f94ca71969ad181f4d94af898c2 100644 (file)
@@ -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)
 
index 95d8dde7fad3a0ef2bbfc6823a1b35192bbdab28..dd173849854bfe1e1c6dab1c14d7e6f34f2bae24 100644 (file)
@@ -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);