pidgin.vv: e9694624: Fix embedding video when the sink is a g...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Fri Apr 3 02:50:48 EDT 2009


-----------------------------------------------------------------
Revision: e96946247af706aaed5cdf339d1a02a9882cb672
Ancestor: e884d4dd14f460cdeedd78e6756093bd6aa043d6
Author: maiku at soc.pidgin.im
Date: 2009-04-03T04:40:36
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/e96946247af706aaed5cdf339d1a02a9882cb672

Modified files:
        libpurple/mediamanager.c

ChangeLog: 

Fix embedding video when the sink is a gconfvideosrc pointing to an 
autovideosrc.

-------------- next part --------------
============================================================
--- libpurple/mediamanager.c	cb237c886bd8a9cf1beb9670759be6ba134fbfca
+++ libpurple/mediamanager.c	08f2901451e6efec56a3c0d1bb2d5b36a5b9b19d
@@ -613,19 +613,26 @@ window_id_cb(GstBus *bus, GstMessage *ms
 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
 


More information about the Commits mailing list