From 39d2ef5136a7c50458567a9be643bfcaaccfdff5 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Tue, 17 Aug 2010 16:26:41 +0200 Subject: [PATCH] pulseutil: include pid value in gst_pulse_client_name() fallback return value Fixes bug #627162 --- configure.ac | 4 ++++ ext/pulse/pulseutil.c | 9 ++++++++- win32/common/config.h | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 68c334b..d338662 100644 --- a/configure.ac +++ b/configure.ac @@ -780,6 +780,10 @@ AG_GST_CHECK_FEATURE(LIBPNG, [Portable Network Graphics library], png, [ dnl *** pulseaudio *** translit(dnm, m, l) AM_CONDITIONAL(USE_PULSE, true) AG_GST_CHECK_FEATURE(PULSE, [pulseaudio plug-in], pulseaudio, [ + + dnl used in ext/pulse/pulseutil.c + AC_CHECK_HEADERS([process.h]) + AG_GST_PKG_CHECK_MODULES(PULSE, libpulse >= 0.9.10) AG_GST_PKG_CHECK_MODULES(PULSE_0_9_11, libpulse >= 0.9.11) if test x$HAVE_PULSE_0_9_11 = xyes; then diff --git a/ext/pulse/pulseutil.c b/ext/pulse/pulseutil.c index f28ba3c..2541459 100644 --- a/ext/pulse/pulseutil.c +++ b/ext/pulse/pulseutil.c @@ -26,6 +26,13 @@ #include "pulseutil.h" #include +#ifdef HAVE_UNISTD_H +# include /* getpid on UNIX */ +#endif +#ifdef HAVE_PROCESS_H +# include /* getpid on win32 */ +#endif + static const pa_channel_position_t gst_pos_to_pa[GST_AUDIO_CHANNEL_POSITION_NUM] = { [GST_AUDIO_CHANNEL_POSITION_FRONT_MONO] = PA_CHANNEL_POSITION_MONO, @@ -125,7 +132,7 @@ gst_pulse_client_name (void) else if (pa_get_binary_name (buf, sizeof (buf))) return g_strdup (buf); else - return g_strdup ("GStreamer"); + return g_strdup_printf ("GStreamer-pid-%lu", (gulong) getpid ()); } pa_channel_map * diff --git a/win32/common/config.h b/win32/common/config.h index 85cda65..ee06207 100644 --- a/win32/common/config.h +++ b/win32/common/config.h @@ -255,6 +255,9 @@ /* Define to enable OSX video (used by osxvideosink). */ #undef HAVE_OSX_VIDEO +/* Define to 1 if you have the header file. */ +#define HAVE_PROCESS_H 1 + /* Define to enable pulseaudio plug-in (used by pulseaudio). */ #undef HAVE_PULSE -- 2.7.4