gst/gstbin.override: Release the GIL in GstBin overrides.
authorEdward Hervey <bilboed@bilboed.com>
Thu, 19 Apr 2007 15:43:16 +0000 (15:43 +0000)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 19 Apr 2007 15:43:16 +0000 (15:43 +0000)
Original commit message from CVS:
* gst/gstbin.override:
Release the GIL in GstBin overrides.

ChangeLog
common
gst/gstbin.override

index 89ae9f8..2cbd201 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-19  Edward Hervey  <edward@fluendo.com>
+
+       * gst/gstbin.override:
+       Release the GIL in GstBin overrides.
+
 2007-04-13  Jan Schmidt  <thaytan@mad.scientist.com>
 
        * gst/gstelement.override:
diff --git a/common b/common
index 9097e25..765d03a 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 9097e252e477e18182f08a032d8860bdee9a0416
+Subproject commit 765d03a88492fb4ac81d70457f671f3a109e93de
index f82a643..a1a21b4 100644 (file)
@@ -48,8 +48,13 @@ _wrap_gst_bin_add(PyGObject *self, PyObject *args)
        }
        
        for (i = 0; i < len; i++) {
+               gboolean rest;
+
                element = (PyGObject*)PyTuple_GetItem(args, i);
-               if (!gst_bin_add(GST_BIN(self->obj), GST_ELEMENT(element->obj))) {
+               pyg_begin_allow_threads;
+               rest = gst_bin_add(GST_BIN(self->obj), GST_ELEMENT(element->obj));
+               pyg_end_allow_threads;
+               if (!rest) {
                        PyErr_Format(PyGstExc_AddError, "Could not add element '%s'", GST_OBJECT_NAME(element->obj));
                        return NULL;
                 }
@@ -94,8 +99,12 @@ _wrap_gst_bin_remove(PyGObject *self, PyObject *args)
        }
        
        for (i = 0; i < len; i++) {
+               gboolean rest;
                element = (PyGObject*)PyTuple_GetItem(args, i);
-               if (!gst_bin_remove(GST_BIN(self->obj), GST_ELEMENT(element->obj))) {
+               pyg_begin_allow_threads;
+               rest = gst_bin_remove(GST_BIN(self->obj), GST_ELEMENT(element->obj));
+               pyg_end_allow_threads;
+               if (!rest) {
                        PyErr_Format(PyGstExc_RemoveError, "Could not remove element '%s'", GST_OBJECT_NAME(element->obj));
                        return NULL;
                }