From 7e06ad12c68b20ec5f4e409e5e0b2ef33afbc77e Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 12 Jun 2008 11:11:49 +0000 Subject: [PATCH] Re-opens #514717 Original commit message from CVS: * gst/gstpad.override: * testsuite/test_pad.py: Revert 2008-02-10 Alessandro Decina Re-opens #514717 --- ChangeLog | 7 +++++++ common | 2 +- gst/gstpad.override | 1 - testsuite/test_pad.py | 48 ++++++++++++++++++++++--------------------- 4 files changed, 33 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59ca3784c3..090d6d40c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-12 Edward Hervey + + * gst/gstpad.override: + * testsuite/test_pad.py: + Revert 2008-02-10 Alessandro Decina + Re-opens #514717 + 2008-06-05 Jan Schmidt * configure.ac: diff --git a/common b/common index 68fb019d40..46ec7dfc1c 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 68fb019d4044b9878aef4ca223fc13c19ffc7d0c +Subproject commit 46ec7dfc1c09ff550ed6b7a4e0d3f2b2ac7d3ee8 diff --git a/gst/gstpad.override b/gst/gstpad.override index 6df09712d6..8b32124115 100644 --- a/gst/gstpad.override +++ b/gst/gstpad.override @@ -1343,7 +1343,6 @@ pad_block_callback_marshal(GstPad *pad, gboolean blocked, gpointer user_data) ret = PyObject_CallObject(callback, args); Py_DECREF(args); - Py_DECREF(py_user_data); if (!ret) PyErr_Print(); diff --git a/testsuite/test_pad.py b/testsuite/test_pad.py index d813536d2d..e255de4fa1 100644 --- a/testsuite/test_pad.py +++ b/testsuite/test_pad.py @@ -516,37 +516,39 @@ class PadRefCountTest(TestCase): self.assertEquals(self.gccollect(), 1) # collected the pad gst.debug('going into teardown') -class PadBlockRefcountTest(TestCase): - def testCallbackRefcount(self): - def blocked_cb(pad, blocked): - self.assertTrue(pad.set_blocked_async(False, unblocked_cb)) +# re-enable this test once #514717 is fixed - def unblocked_cb(pad, blocked): - pass +# class PadBlockRefcountTest(TestCase): +# def testCallbackRefcount(self): +# def blocked_cb(pad, blocked): +# self.assertTrue(pad.set_blocked_async(False, unblocked_cb)) - cb_refcount = sys.getrefcount(blocked_cb) - # sys.getrefcount() returns refcount + 1 - self.assertEquals(cb_refcount, 2) +# def unblocked_cb(pad, blocked): +# pass - fakesrc = gst.element_factory_make('fakesrc') - fakesrc.props.num_buffers = 2 - fakesink = gst.element_factory_make('fakesink') +# cb_refcount = sys.getrefcount(blocked_cb) +# # sys.getrefcount() returns refcount + 1 +# self.assertEquals(cb_refcount, 2) - pipeline = gst.Pipeline() - pipeline.add(fakesrc, fakesink) +# fakesrc = gst.element_factory_make('fakesrc') +# fakesrc.props.num_buffers = 2 +# fakesink = gst.element_factory_make('fakesink') - fakesrc.link(fakesink) +# pipeline = gst.Pipeline() +# pipeline.add(fakesrc, fakesink) - pad = fakesrc.get_pad('src') - pad.set_blocked_async(True, blocked_cb) +# fakesrc.link(fakesink) - pipeline.set_state(gst.STATE_PLAYING) - pipeline.get_bus().poll(gst.MESSAGE_EOS, -1) - pipeline.set_state(gst.STATE_NULL) +# pad = fakesrc.get_pad('src') +# pad.set_blocked_async(True, blocked_cb) - # check that we don't leak a ref to the callback - cb_refcount_after = sys.getrefcount(blocked_cb) - self.assertEquals(cb_refcount_after, cb_refcount) +# pipeline.set_state(gst.STATE_PLAYING) +# pipeline.get_bus().poll(gst.MESSAGE_EOS, -1) +# pipeline.set_state(gst.STATE_NULL) + +# # check that we don't leak a ref to the callback +# cb_refcount_after = sys.getrefcount(blocked_cb) +# self.assertEquals(cb_refcount_after, cb_refcount) if __name__ == "__main__":