--- a/gst_plugins_base/gst-libs/gst/pbutils/install-plugins.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/pbutils/install-plugins.c Wed Mar 24 18:04:17 2010 -0500
@@ -144,7 +144,7 @@
* as interlocutor to the real installer though, even more so if command line
* argument munging is required to transform the command line arguments
* passed by GStreamer to the helper application into arguments that are
- * understood by the reeal installer.
+ * understood by the real installer.
* </para>
* <para>
* The helper application path defined at compile time can be overriden at
@@ -370,6 +370,8 @@
#include <sys/wait.h>
#endif
+#include <string.h>
+
/* best effort to make things compile and possibly even work on win32 */
#ifndef WEXITSTATUS
# define WEXITSTATUS(status) ((((guint)(status)) & 0xff00) >> 8)
@@ -393,8 +395,9 @@
*
* This function is for X11-based applications (such as most Gtk/Qt
* applications on linux/unix) only. You can use it to tell the external
- * the XID of your main application window, so the installer can make its
- * own window transient to your application windonw during the installation.
+ * installer the XID of your main application window. That way the installer
+ * can make its own window transient to your application window during the
+ * installation.
*
* If set, the XID will be passed to the installer via a --transient-for=XID
* command line option.
@@ -509,6 +512,18 @@
}
static gboolean
+ptr_array_contains_string (GPtrArray * arr, const gchar * s)
+{
+ gint i;
+
+ for (i = 0; i < arr->len; ++i) {
+ if (strcmp ((const char *) g_ptr_array_index (arr, i), s) == 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static gboolean
gst_install_plugins_spawn_child (gchar ** details,
GstInstallPluginsContext * ctx, GPid * child_pid, gint * exit_status)
{
@@ -528,9 +543,10 @@
g_ptr_array_add (arr, xid_str);
}
- /* finally, add the detail strings */
+ /* finally, add the detail strings, but without duplicates */
while (details != NULL && details[0] != NULL) {
- g_ptr_array_add (arr, details[0]);
+ if (!ptr_array_contains_string (arr, details[0]))
+ g_ptr_array_add (arr, details[0]);
++details;
}