From a70c226dc3886bd7c1342735a100a378a3a2c1a3 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 26 May 2008 10:20:06 +0000 Subject: [PATCH] gst/gstevent.override: gst_event_new_tag takes ownership of the GstTagList given as argument, therefore make a copy b... 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 | 8 ++++++++ common | 2 +- gst/gstevent.override | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5144f6c..3a3bc68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-26 Edward Hervey + + * 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 * gst/extend/discoverer.py: diff --git a/common b/common index 3b36310..032f2d9 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 3b3631082d04b426f450810e8836de94e9c5d60a +Subproject commit 032f2d973bd5c9a9b457cb5fc72d13dafe85c01e diff --git a/gst/gstevent.override b/gst/gstevent.override index 516963f..b2eb455 100644 --- a/gst/gstevent.override +++ b/gst/gstevent.override @@ -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; +} -- 2.7.4