[totem] Fix race in GstXOverlay discovery/use
- From: Jan Schmidt <jschmidt src gnome org>
- To: svn-commits-list gnome org
- Subject: [totem] Fix race in GstXOverlay discovery/use
- Date: Wed, 13 May 2009 08:23:53 -0400 (EDT)
commit 2fee0322d8a4db4931ff18a89b30dfd633bddd22
Author: Jan Schmidt <thaytan noraisin net>
Date: Wed May 13 13:10:39 2009 +0100
Fix race in GstXOverlay discovery/use
2009-05-13 Jan Schmidt <thaytan noraisin net>
* src/backend/bacon-video-widget-gst-0.10.c (bvw_element_msg_sync):
Avoid a race with xoverlay interface discovery. Because the
update_interface implementations function only searches for interfaces
from the main gui thread, there's a race when the sync_msg comes in
requesting an xid to embed and the xoverlay interface isn't available
until the gui thread updates it.
Avoid the race by using the sender of the message when it (as it
always should) implements the GstXOverlay interface.
---
ChangeLog | 12 ++++++++++++
src/backend/bacon-video-widget-gst-0.10.c | 5 +++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f509d52..063bd35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2009-05-13 Jan Schmidt <thaytan noraisin net>
+
+ * src/backend/bacon-video-widget-gst-0.10.c (bvw_element_msg_sync):
+ Avoid a race with xoverlay interface discovery. Because the
+ update_interface implementations function only searches for interfaces
+ from the main gui thread, there's a race when the sync_msg comes in
+ requesting an xid to embed and the xoverlay interface isn't available
+ until the gui thread updates it.
+
+ Avoid the race by using the sender of the message when it (as it
+ always should) implements the GstXOverlay interface.
+
2009-05-13 Bastien Nocera <hadess hadess net>
* src/totem-uri.c (totem_uri_get_cached_subtitle_for_uri):
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index 34570bb..af73ab0 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -5749,6 +5749,11 @@ bvw_element_msg_sync (GstBus *bus, GstMessage *msg, gpointer data)
g_mutex_lock (bvw->priv->lock);
bvw_update_interface_implementations (bvw);
+ if (bvw->priv->xoverlay == NULL) {
+ GstObject *sender = GST_MESSAGE_SRC (msg);
+ if (sender && GST_IS_X_OVERLAY (sender))
+ bvw->priv->xoverlay = GST_X_OVERLAY (gst_object_ref (sender));
+ }
g_mutex_unlock (bvw->priv->lock);
g_return_if_fail (bvw->priv->xoverlay != NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]