pidgin: aca28988: Revert the dependency on gstreamer-0.10 ...

resiak at soc.pidgin.im resiak at soc.pidgin.im
Mon Mar 17 09:40:42 EDT 2008


-----------------------------------------------------------------
Revision: aca28988d0e09ad0e24d6b2e36a83eea403d1cde
Ancestor: 33bd2430510196431b931ccb1fa0b55777482dd0
Author: resiak at soc.pidgin.im
Date: 2008-03-17T13:38:34
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/aca28988d0e09ad0e24d6b2e36a83eea403d1cde

Modified files:
        configure.ac pidgin/gtkmain.c pidgin/gtksound.c

ChangeLog: 

Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
hack on gstreamers which can't disable forking.  This should keep both Alver
and Stu happy in their respective stone-ages.

-------------- next part --------------
============================================================
--- configure.ac	74b3e3bf7ee65abb422256d51d9a6c0177f53386
+++ configure.ac	364b542ad46fcec3865ff21088c1cffa729d9d7c
@@ -658,14 +658,21 @@ dnl ####################################
 dnl #######################################################################
 dnl # Check for GStreamer
 dnl #######################################################################
+dnl
+dnl TODO: Depend on gstreamer >= 0.10.10, and remove the conditional use of
+dnl       gst_registry_fork_set_enabled.
 AC_ARG_ENABLE(gstreamer,
 	[AC_HELP_STRING([--disable-gstreamer], [compile without GStreamer audio support])],
 	enable_gst="$enableval", enable_gst="yes")
 if test "x$enable_gst" != "xno"; then
-	PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10 >= 0.10.10], [
+	PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10], [
 		AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for playing sounds])
 		AC_SUBST(GSTREAMER_CFLAGS)
 		AC_SUBST(GSTREAMER_LIBS)
+		AC_CHECK_LIB(gstreamer-0.10, gst_registry_fork_set_enabled,
+			[ AC_DEFINE(GST_CAN_DISABLE_FORKING, [],
+			  [Define if gst_registry_fork_set_enabled exists])],
+			[], [$GSTREAMER_LIBS])
 	], [
 		AC_MSG_RESULT(no)
 		enable_gst="no"
============================================================
--- pidgin/gtkmain.c	ba2f20f164c96e9a6f463f1468847a2cf83b8006
+++ pidgin/gtkmain.c	7de342543d15c91effcc44667d5ae879d665e50b
@@ -99,6 +99,9 @@ static const int catch_sig_list[] = {
 	SIGTERM,
 	SIGQUIT,
 	SIGCHLD,
+#if defined(USE_GSTREAMER) && !defined(GST_CAN_DISABLE_FORKING)
+	SIGALRM,
+#endif
 	-1
 };
 
@@ -188,9 +191,27 @@ sighandler(int sig)
 		fprintf(stderr, "%s", segfault_message);
 		abort();
 		break;
+#if defined(USE_GSTREAMER) && !defined(GST_CAN_DISABLE_FORKING)
+/* By default, gstreamer forks when you initialize it, and waitpids for the
+ * child.  But if libpurple reaps the child rather than leaving it to
+ * gstreamer, gstreamer's initialization fails.  So, we wait a second before
+ * reaping child processes, to give gst a chance to reap it if it wants to.
+ *
+ * This is not needed in later gstreamers, which let us disable the forking.
+ * And, it breaks the world on some Real Unices.
+ */
 	case SIGCHLD:
+		/* Restore signal catching */
+		signal(SIGCHLD, sighandler);
+		alarm(1);
+		break;
+	case SIGALRM:
+#else
+	case SIGCHLD:
+#endif
 		clean_pid();
-		signal(SIGCHLD, sighandler);    /* restore signal catching on this one! */
+		/* Restore signal catching */
+		signal(SIGCHLD, sighandler);
 		break;
 	default:
 		purple_debug_warning("sighandler", "Caught signal %d\n", sig);
============================================================
--- pidgin/gtksound.c	dfc2a2429ae9e08398e5b65bb84d049d5d7f5f8e
+++ pidgin/gtksound.c	0ad48b90c65f4e50724d8b888ee65cd03189451c
@@ -302,7 +302,9 @@ pidgin_sound_init(void)
 
 #ifdef USE_GSTREAMER
 	purple_debug_info("sound", "Initializing sound output drivers.\n");
+#ifdef GST_CAN_DISABLE_FORKING
 	gst_registry_fork_set_enabled (FALSE);
+#endif
 	if ((gst_init_failed = !gst_init_check(NULL, NULL, &error))) {
 		purple_notify_error(NULL, _("GStreamer Failure"),
 					_("GStreamer failed to initialize."),


More information about the Commits mailing list