changeset 26182:23038e1a1754

Fix intermittent crash upon hangup when removing output windows.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Thu, 05 Feb 2009 11:47:36 +0000
parents 218f052b9bf5
children f06eb6e7d907
files libpurple/media.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Thu Feb 05 00:15:13 2009 +0000
+++ b/libpurple/media.c	Thu Feb 05 11:47:36 2009 +0000
@@ -2338,10 +2338,6 @@
 
 		bin = gst_bin_new(NULL);
 
-		if (stream->sink != NULL)
-			gst_bin_add(GST_BIN(GST_ELEMENT_PARENT(
-					stream->sink)), bin);
-
 		name = g_strdup_printf("stream-sink_%s_%s",
 				session_id, participant);
 		sink = gst_element_factory_make("autovideosink", name);
@@ -2409,6 +2405,7 @@
 		gst_element_release_request_pad(GST_ELEMENT_PARENT(peer), peer);
 		gst_object_unref(peer);
 
+		gst_element_set_locked_state(sink, TRUE);
 		gst_element_set_state(sink, GST_STATE_NULL);
 
 		gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(sink)), sink);
@@ -2449,6 +2446,7 @@
 	peer = gst_pad_get_peer(pad);
 	gst_object_unref(pad);
 	gst_pad_set_blocked_async(peer, TRUE, dummy_block_cb, NULL);
+	gst_element_set_locked_state(sink, TRUE);
 	gst_element_set_state(sink, GST_STATE_NULL);
 	gst_bin_remove(GST_BIN(parent), sink);