Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/jukeboxactivity.py
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2011-06-06 21:58:58 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2011-06-07 10:46:54 (GMT)
commit54224840420201a8fb227303214f88e9c10deb39 (patch)
treeb82c39e50f354a0b34ac3a50a38264fee70b7d10 /jukeboxactivity.py
parentd58364434a046f55b1086dfdcdb830307762db98 (diff)
Don't call into GTK+ when setting video sink from gstreamer thread
As noted at http://bugs.sugarlabs.org/ticket/2853 Jukebox often crashes when loading content or shows its content in the wrong window. This is because it is calling into GTK+ from the gstreamer thread, without taking the appropriate locks. Fix this by following the suggestion of the gstreamer documentation, where the xid is queried earlier from the correct thread: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html
Diffstat (limited to 'jukeboxactivity.py')
-rw-r--r--jukeboxactivity.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index fc20f2b..9366fb5 100644
--- a/jukeboxactivity.py
+++ b/jukeboxactivity.py
@@ -423,7 +423,9 @@ class GstPlayer(gobject.GObject):
self.player.set_property('vis-plugin', vis_plug)
self.overlay = None
+ videowidget.realize()
self.videowidget = videowidget
+ self.videowidget_xid = videowidget.window.xid
self._init_video_sink()
bus = self.player.get_bus()
@@ -439,7 +441,7 @@ class GstPlayer(gobject.GObject):
if message.structure is None:
return
if message.structure.get_name() == 'prepare-xwindow-id':
- self.videowidget.set_sink(message.src)
+ self.videowidget.set_sink(message.src, self.videowidget_xid)
message.src.set_property('force-aspect-ratio', True)
def on_message(self, bus, message):
@@ -581,10 +583,9 @@ class VideoWidget(gtk.DrawingArea):
else:
return True
- def set_sink(self, sink):
- assert self.window.xid
+ def set_sink(self, sink, xid):
self.imagesink = sink
- self.imagesink.set_xwindow_id(self.window.xid)
+ self.imagesink.set_xwindow_id(xid)