mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-14 03:15:47 +00:00
tests/examples/: More gcc4 fixes and a mem leak fix.
Original commit message from CVS: * tests/examples/typefind/typefind.c: (type_found): * tests/examples/xml/runxml.c: (xml_loaded): More gcc4 fixes and a mem leak fix.
This commit is contained in:
parent
c67dbe5deb
commit
ed1d0dfd9d
3 changed files with 17 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-12-12 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* tests/examples/typefind/typefind.c: (type_found):
|
||||
* tests/examples/xml/runxml.c: (xml_loaded):
|
||||
More gcc4 fixes and a mem leak fix.
|
||||
|
||||
2005-12-12 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* tests/examples/xml/createxml.c: (object_saved):
|
||||
|
|
|
@ -6,10 +6,11 @@ type_found (GstElement * typefind, const GstCaps * caps)
|
|||
xmlDocPtr doc;
|
||||
xmlNodePtr parent;
|
||||
|
||||
doc = xmlNewDoc ("1.0");
|
||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
|
||||
doc = xmlNewDoc ((xmlChar *) "1.0");
|
||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *) "Capabilities",
|
||||
NULL);
|
||||
|
||||
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
|
||||
parent = xmlNewChild (doc->xmlRootNode, NULL, (xmlChar *) "Caps1", NULL);
|
||||
/* FIXME */
|
||||
//gst_caps_save_thyself (caps, parent);
|
||||
|
||||
|
|
|
@ -10,15 +10,18 @@ xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data)
|
|||
xmlNodePtr children = self->xmlChildrenNode;
|
||||
|
||||
while (children) {
|
||||
if (!strcmp (children->name, (xmlChar *) "comment")) {
|
||||
if (!strcmp ((const char *) children->name, "comment")) {
|
||||
xmlNodePtr nodes = children->xmlChildrenNode;
|
||||
|
||||
while (nodes) {
|
||||
if (!strcmp (nodes->name, (xmlChar *) "text")) {
|
||||
if (!strcmp ((const char *) nodes->name, "text")) {
|
||||
gchar *name = g_strdup ((gchar *) xmlNodeGetContent (nodes));
|
||||
gchar *obj_name = gst_object_get_name (object);
|
||||
|
||||
g_print ("object %s loaded with comment '%s'\n",
|
||||
gst_object_get_name (object), name);
|
||||
g_print ("object %s loaded with comment '%s'\n", obj_name, name);
|
||||
|
||||
g_free (obj_name);
|
||||
g_free (name);
|
||||
}
|
||||
nodes = nodes->next;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue