? gst-libs
? gst-python-0.9.0.1
? docs/README.html
? docs/README.txt
? docs/gst-python.ent
? docs/tmpbuildcatalog
? examples/cooldance.ogg
? examples/core.21556
? examples/core.23683
? examples/dv.ogg
? examples/foo-tester
? examples/fvumeter.pyc
? examples/progress-window-mockup.gazpacho
? examples/remuxer.pyc
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-python/ChangeLog,v
retrieving revision 1.445
diff -u -r1.445 ChangeLog
--- ChangeLog	19 Apr 2006 08:50:48 -0000	1.445
+++ ChangeLog	19 Apr 2006 09:12:51 -0000
@@ -1,5 +1,11 @@
 2006-04-19  Andy Wingo  <wingo@pobox.com>
 
+	* gst/gstpad.override (pad_block_callback_marshal) 
+	(_wrap_gst_pad_set_blocked_async): Fix refcounting problems and
+	indent.
+
+2006-04-19  Andy Wingo  <wingo@pobox.com>
+
 	* examples/remuxer.py: Another code dump. I know it breaks the
 	freeze but it's just a wee example :)
 
Index: gst/gstpad.override
===================================================================
RCS file: /cvs/gstreamer/gst-python/gst/gstpad.override,v
retrieving revision 1.30
diff -u -r1.30 gstpad.override
--- gst/gstpad.override	5 Apr 2006 08:37:32 -0000	1.30
+++ gst/gstpad.override	19 Apr 2006 09:12:51 -0000
@@ -963,9 +963,7 @@
     PyGILState_STATE state;
     PyObject *callback, *args;
     PyObject *ret;
-    PyObject *py_data;
     PyObject *py_user_data;
-    gint len, i;
 
     g_return_if_fail(user_data != NULL);
 
@@ -973,32 +971,26 @@
 
     py_user_data = (PyObject *) user_data;
 
-    if (blocked)
-    py_data = Py_True;
-    else
-    py_data = Py_False;
-    Py_INCREF(py_data);
-
     callback = PyTuple_GetItem(py_user_data, 0);
-    args = Py_BuildValue("(NN)",
+    args = Py_BuildValue("(NO)",
              pygstobject_new(G_OBJECT(pad)),
-             py_data);
-
-    len = PyTuple_Size(py_user_data);
-    for (i = 1; i < len; ++i) {
-        PyObject *tuple = args;
-        args = PySequence_Concat(tuple, PyTuple_GetItem(py_user_data, i));
-        Py_DECREF(tuple);
+             blocked ? Py_True : Py_False);
+    
+    {
+        PyObject *tmp = args;
+        args = PySequence_Concat(tmp, PyTuple_GetItem(py_user_data, 1));
+        Py_DECREF (tmp);
     }
+
     ret = PyObject_CallObject(callback, args);
+    Py_DECREF(args);
 
     if (!ret)
         PyErr_Print();
+    else
+        Py_DECREF(ret);
     
-    Py_DECREF(py_data);
-    Py_DECREF(args);
     pyg_gil_state_release(state);
-
 }
 
 static PyObject *
@@ -1013,29 +1005,29 @@
     len = PyTuple_Size(args);
 
     if (len < 2) {
-    PyErr_SetString(PyExc_TypeError, "Requires at least 2 arg");
-    return NULL;
+        PyErr_SetString(PyExc_TypeError, "Requires at least 2 arg");
+        return NULL;
     }
-    pblocked = PySequence_GetItem(args, 0);
+    pblocked = PyTuple_GetItem(args, 0);
     blocked = PyObject_IsTrue(pblocked);
 
-    callback = PySequence_GetItem(args, 1);
+    callback = PyTuple_GetItem(args, 1);
     if (!PyCallable_Check(callback)) {
-    PyErr_SetString(PyExc_TypeError, "callback is not callable");
-    return NULL;
+        PyErr_SetString(PyExc_TypeError, "callback is not callable");
+        return NULL;
     }
     cbargs = PySequence_GetSlice(args, 2, len);
     if (cbargs == NULL)
-    return NULL;
+        return NULL;
     data = Py_BuildValue("(ON)", callback, cbargs);
     if (data == NULL)
-    return NULL;
+        return NULL;
     ret = gst_pad_set_blocked_async (GST_PAD (self->obj), blocked,
-                     (GstPadBlockCallback) pad_block_callback_marshal, data);
+        (GstPadBlockCallback) pad_block_callback_marshal, data);
     if (ret)
-    pret = Py_True;
+        pret = Py_True;
     else
-    pret = Py_False;
+        pret = Py_False;
     Py_INCREF(pret);
 
     return pret;
