[pitivi] Workaround a bug in gst.Pad.set_blocked_async that causes a segfault.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] Workaround a bug in gst.Pad.set_blocked_async that causes a segfault.
- Date: Thu, 13 Aug 2009 10:09:25 +0000 (UTC)
commit 6539c289f24f28e87022312b2a99edc562c9c660
Author: Alessandro Decina <alessandro d gmail com>
Date: Thu Aug 13 11:08:27 2009 +0200
Workaround a bug in gst.Pad.set_blocked_async that causes a segfault.
pad_block_destroy_data used to call CPython without acquiring the GIL. This is
now fixed in gst-python git, but we add this workaround so that we don't have to
bump the dependency.
pitivi/elements/singledecodebin.py | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/pitivi/elements/singledecodebin.py b/pitivi/elements/singledecodebin.py
index 7b971bc..a86cbcc 100644
--- a/pitivi/elements/singledecodebin.py
+++ b/pitivi/elements/singledecodebin.py
@@ -304,23 +304,27 @@ class SingleDecodeBin(gst.Bin):
self.post_message(gst.message_new_state_dirty(self))
def _blockPad(self, target):
+ # don't pass target as an argument to set_blocked_async. Avoids
+ # triggering a bug in gst-python where pad_block_destroy_data calls
+ # CPython without acquiring the GIL
+ self._target = target
self._eventProbeId = target.add_event_probe(self._padEventCb)
- self._srcpad.set_blocked_async(True, self._padBlockedCb, target)
+ self._srcpad.set_blocked_async(True, self._padBlockedCb)
def _unblockPad(self, target):
target.remove_event_probe(self._eventProbeId)
self._eventProbeId = None
- self._srcpad.set_blocked_async(False, self._padBlockedCb, target)
+ self._srcpad.set_blocked_async(False, self._padBlockedCb)
- def _padBlockedCb(self, ghost, blocked, target):
+ def _padBlockedCb(self, ghost, blocked):
if not blocked:
if self.pending_newsegment is not None:
self._srcpad.push_event(self.pending_newsegment)
self.pending_newsegment = None
return
- self._exposePad(target=target)
- self._unblockPad(target=target)
+ self._exposePad(target=self._target)
+ self._unblockPad(target=self._target)
def _padEventCb(self, pad, event):
if event.type != gst.EVENT_NEWSEGMENT:
@@ -367,6 +371,7 @@ class SingleDecodeBin(gst.Bin):
if self._srcpad:
self.remove_pad(self._srcpad)
self._srcpad = None
+ self._target = None
for element in self._validelements:
element.set_state(gst.STATE_NULL)
self.remove(element)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]