gst/gstlibs.override: Fixes for GstController creation memleak fixes.
Original commit message from CVS: Patch by: Rene Stadler <mail@renestadler.de> * gst/gstlibs.override: Fixes for GstController creation memleak fixes.
This commit is contained in:
parent
077452cf30
commit
75b33a6cab
@ -1,3 +1,10 @@
|
|||||||
|
2006-09-22 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
|
Patch by: Rene Stadler <mail@renestadler.de>
|
||||||
|
* gst/gstlibs.override:
|
||||||
|
Fixes for GstController creation
|
||||||
|
memleak fixes.
|
||||||
|
|
||||||
2006-09-12 Edward Hervey <edward@fluendo.com>
|
2006-09-12 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
* gst/extend/Makefile.am:
|
* gst/extend/Makefile.am:
|
||||||
|
2
common
2
common
@ -1 +1 @@
|
|||||||
Subproject commit d287125f93da692bc25d53b0b7b0e2f90424a212
|
Subproject commit a8c15b7a2c75fc2bd83850cb17cb05a1ee84ecaf
|
@ -95,6 +95,7 @@ override gst_controller_new_list args
|
|||||||
static int
|
static int
|
||||||
_wrap_gst_controller_new_list(PyGObject *self, PyObject *args)
|
_wrap_gst_controller_new_list(PyGObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
|
PyObject *target_pyobj;
|
||||||
PyGObject *target;
|
PyGObject *target;
|
||||||
gint len;
|
gint len;
|
||||||
GList *list = NULL;
|
GList *list = NULL;
|
||||||
@ -103,7 +104,18 @@ _wrap_gst_controller_new_list(PyGObject *self, PyObject *args)
|
|||||||
PyErr_SetString(PyExc_TypeError, "Controller requires at least a target object");
|
PyErr_SetString(PyExc_TypeError, "Controller requires at least a target object");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
target = (PyGObject *) PyTuple_GetItem(args, 0);
|
|
||||||
|
target_pyobj = PyTuple_GetItem(args, 0);
|
||||||
|
if (!PyObject_TypeCheck(target_pyobj, &PyGObject_Type)) {
|
||||||
|
PyErr_Format(PyExc_TypeError,
|
||||||
|
"argument 1 must be %s, not %s",
|
||||||
|
PyGObject_Type.tp_name,
|
||||||
|
target_pyobj == Py_None ? "None" : target_pyobj->ob_type->tp_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
target = (PyGObject *) target_pyobj;
|
||||||
|
|
||||||
if (len > 1)
|
if (len > 1)
|
||||||
while (len-- > 1) {
|
while (len-- > 1) {
|
||||||
PyObject *temp;
|
PyObject *temp;
|
||||||
@ -111,11 +123,16 @@ _wrap_gst_controller_new_list(PyGObject *self, PyObject *args)
|
|||||||
|
|
||||||
temp = PyTuple_GetItem(args, len);
|
temp = PyTuple_GetItem(args, len);
|
||||||
str = PyString_AsString(temp);
|
str = PyString_AsString(temp);
|
||||||
|
if (str == NULL) {
|
||||||
|
g_list_free (list);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
GST_INFO("prepending %s [%d]", str, len);
|
GST_INFO("prepending %s [%d]", str, len);
|
||||||
list = g_list_prepend(list, PyString_AsString(temp));
|
list = g_list_prepend(list, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
self->obj = (GObject *) gst_controller_new_list(target->obj, list);
|
self->obj = (GObject *) gst_controller_new_list(target->obj, list);
|
||||||
|
g_list_free (list);
|
||||||
|
|
||||||
if (!self->obj) {
|
if (!self->obj) {
|
||||||
PyErr_SetString(PyExc_RuntimeError, "could not create GstController object");
|
PyErr_SetString(PyExc_RuntimeError, "could not create GstController object");
|
||||||
@ -147,11 +164,16 @@ _wrap_gst_controller_remove_properties (PyGObject *self, PyObject *args)
|
|||||||
|
|
||||||
temp = PyTuple_GetItem(args, len);
|
temp = PyTuple_GetItem(args, len);
|
||||||
str = PyString_AsString(temp);
|
str = PyString_AsString(temp);
|
||||||
|
if (str == NULL) {
|
||||||
|
g_list_free (list);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
GST_INFO("prepending %s [%d]", str, len);
|
GST_INFO("prepending %s [%d]", str, len);
|
||||||
list = g_list_prepend(list, PyString_AsString(temp));
|
list = g_list_prepend(list, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
res = gst_controller_remove_properties_list(controller, list);
|
res = gst_controller_remove_properties_list(controller, list);
|
||||||
|
g_list_free (list);
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
pret = Py_True;
|
pret = Py_True;
|
||||||
@ -213,6 +235,7 @@ _wrap_gst_controller_set_from_list (PyGObject *self, PyObject *args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
res = gst_controller_set_from_list(controller, pname, list);
|
res = gst_controller_set_from_list(controller, pname, list);
|
||||||
|
g_slist_free (list);
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
pret = Py_True;
|
pret = Py_True;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user