Re: [PATCH spice-gtk v2] configure: Try gstreamer audio backend if pulse is not available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hmm, it looks like it would compile fine with both gst & pulse, but at runtime you would only have gst backend, and a leak:

#ifdef WITH_PULSE
    self = SPICE_AUDIO(spice_pulse_new(session, context, name));
#endif
#if defined(WITH_GSTAUDIO)
    self = SPICE_AUDIO(spice_gstaudio_new(session, context, name));
#endif


----- Original Message -----
> Disable audio if no backend is available and configure is used with
> the option '--with-audio=auto'
> ---
> v2: Removed AS_IF cascade, merged with "configure: Do not force audio by
> default"
> ---
>  configure.ac | 23 +++++++++++------------
>  1 file changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 1d8f4d0..dc8557a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -296,19 +296,22 @@ AC_ARG_WITH([audio],
>    [],
>    [with_audio="auto"])
>  
> -AS_IF([test "x$with_audio" = "xauto"], [
> -  AS_IF([test "x$os_win32" = "xyes"], [with_audio=gstreamer],
> [with_audio=pulse])
> -])
> -
>  case "$with_audio" in
> -  gstreamer|pulse|no*)
> +  gstreamer|pulse|auto*)
> +    PKG_CHECK_MODULES(GST, gstreamer-1.0 gstreamer-base-1.0
> gstreamer-app-1.0 gstreamer-audio-1.0, [have_gst=yes], [have_gst=no])
> +    PKG_CHECK_MODULES(PULSE, libpulse libpulse-mainloop-glib,
> [have_pulse=yes], [have_pulse=no])
> +    ;;
> +  no*)
>      ;;
>    *) AC_MSG_ERROR(Unsupported audio backend)
>  esac
>  
> -AS_IF([test "x$with_audio" = "xpulse"],
> -      [PKG_CHECK_MODULES(PULSE, libpulse libpulse-mainloop-glib,
> [have_pulse=yes], [have_pulse=no])],
> -      [have_pulse=no])
> +AS_IF([test "x$with_audio" = "xauto" && test "x$have_pulse" = "xyes"],
> +      [with_audio=pulse])
> +
> +AS_IF([test "x$with_audio" = "xauto" && test "x$have_gst" = "xyes"],
> +      [with_audio=gstreamer],
> +      [with_audio=no])
>  
>  AS_IF([test "x$have_pulse" = "xyes"],
>        [AC_DEFINE([WITH_PULSE], 1, [Have pulseaudio?])],
> @@ -320,10 +323,6 @@ AM_CONDITIONAL([WITH_PULSE], [test "x$have_pulse" =
> "xyes"])
>  AC_SUBST(PULSE_CFLAGS)
>  AC_SUBST(PULSE_LIBS)
>  
> -AS_IF([test "x$with_audio" = "xgstreamer"],
> -      [PKG_CHECK_MODULES(GST, gstreamer-1.0 gstreamer-base-1.0
> gstreamer-app-1.0 gstreamer-audio-1.0, [have_gst=yes], [have_gst=no])],
> -      [have_gst=no])
> -
>  AS_IF([test "x$have_gst" = "xyes"],
>        [AC_DEFINE([WITH_GSTAUDIO], 1, [Have GStreamer 1.0?])],
>        [AS_IF([test "x$with_audio" = "xgstreamer"],
> --
> 2.4.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]