changeset 26494:86c5499f36e8

Fix embedding video when the sink is a gconfvideosrc pointing to an autovideosrc.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Fri, 03 Apr 2009 04:40:36 +0000
parents c9b22d710a22
children a198f064a42c
files libpurple/mediamanager.c
diffstat 1 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/mediamanager.c	Fri Apr 03 03:22:23 2009 +0000
+++ b/libpurple/mediamanager.c	Fri Apr 03 04:40:36 2009 +0000
@@ -613,19 +613,26 @@
 static void
 window_id_cb(GstBus *bus, GstMessage *msg, PurpleMediaOutputWindow *ow)
 {
+	GstElement *sink;
+
 	if (GST_MESSAGE_TYPE(msg) != GST_MESSAGE_ELEMENT ||
 			!gst_structure_has_name(msg->structure,
 			"prepare-xwindow-id"))
 		return;
 
-	if (GST_ELEMENT_PARENT(GST_MESSAGE_SRC(msg)) == ow->sink) {
-		g_signal_handlers_disconnect_matched(bus, G_SIGNAL_MATCH_FUNC
-				| G_SIGNAL_MATCH_DATA, 0, 0, NULL,
-				window_id_cb, ow);
+	sink = GST_ELEMENT(GST_MESSAGE_SRC(msg));
+	while (sink != ow->sink) {
+		if (sink == NULL)
+			return;
+		sink = GST_ELEMENT_PARENT(sink);
+	}
 
-		gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(
-				GST_MESSAGE_SRC(msg)), ow->window_id);
-	}
+	g_signal_handlers_disconnect_matched(bus, G_SIGNAL_MATCH_FUNC
+			| G_SIGNAL_MATCH_DATA, 0, 0, NULL,
+			window_id_cb, ow);
+
+	gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(
+			GST_MESSAGE_SRC(msg)), ow->window_id);
 }
 #endif