gst/gstevent.override: gst_event_new_tag takes ownership of the GstTagList given...
authorEdward Hervey <bilboed@bilboed.com>
Mon, 26 May 2008 10:20:06 +0000 (10:20 +0000)
committerEdward Hervey <bilboed@bilboed.com>
Mon, 26 May 2008 10:20:06 +0000 (10:20 +0000)
Original commit message from CVS:
* gst/gstevent.override:
gst_event_new_tag takes ownership of the GstTagList given
as argument, therefore make a copy before calling the
C function.
Fixes #534888

ChangeLog
common
gst/gstevent.override

index 5144f6c..3a3bc68 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-05-26  Edward Hervey  <edward.hervey@collabora.co.uk>
+
+       * gst/gstevent.override:
+       gst_event_new_tag takes ownership of the GstTagList given
+       as argument, therefore make a copy before calling the
+       C function.
+       Fixes #534888
+
 2008-05-17  Edward Hervey  <edward.hervey@collabora.co.uk>
 
        * gst/extend/discoverer.py:
diff --git a/common b/common
index 3b36310..032f2d9 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 3b3631082d04b426f450810e8836de94e9c5d60a
+Subproject commit 032f2d973bd5c9a9b457cb5fc72d13dafe85c01e
index 516963f..b2eb455 100644 (file)
@@ -235,3 +235,29 @@ _wrap_gst_event_new_custom(PyObject *self, PyObject *args, PyObject *kwargs)
        gst_mini_object_unref((GstMiniObject *)ret);
     return py_ret;
 }
+%%
+override gst_event_new_tag kwargs
+static PyObject *
+_wrap_gst_event_new_tag(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "taglist", NULL };
+    GstTagList *taglist = NULL;
+    PyObject *py_taglist, *py_ret;
+    GstEvent *ret;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:event_new_tag", kwlist, &py_taglist))
+        return NULL;
+    if (pyg_boxed_check(py_taglist, GST_TYPE_TAG_LIST))
+        taglist = pyg_boxed_get(py_taglist, GstTagList);
+    else {
+        PyErr_SetString(PyExc_TypeError, "taglist should be a GstTagList");
+        return NULL;
+    }
+    pyg_begin_allow_threads;
+    ret = gst_event_new_tag(gst_tag_list_copy(taglist));
+    pyg_end_allow_threads;
+    py_ret = pygstminiobject_new((GstMiniObject *)ret);
+    if (ret != NULL)
+       gst_mini_object_unref((GstMiniObject *)ret);
+    return py_ret;
+}