gst/playback/: free cpas using gst_caps_unref, don't leak caps-strings

Original commit message from CVS:
* gst/playback/gstplaybin.c: (add_sink):
* gst/playback/test.c: (main):
* gst/playback/test5.c: (dump_element_stats):
* gst/playback/test6.c: (main):
free cpas using gst_caps_unref, don't leak caps-strings
This commit is contained in:
Stefan Kost 2006-05-02 18:15:25 +00:00
parent bc510bf9b8
commit 868984b414
5 changed files with 16 additions and 3 deletions

View file

@ -1,3 +1,11 @@
2006-05-02 Stefan Kost <ensonic@users.sf.net>
* gst/playback/gstplaybin.c: (add_sink):
* gst/playback/test.c: (main):
* gst/playback/test5.c: (dump_element_stats):
* gst/playback/test6.c: (main):
free cpas using gst_caps_unref, don't leak caps-strings
2006-05-01 Tim-Philipp Müller <tim at centricular dot net>
* gst/typefind/gsttypefindfunctions.c: (musepack_type_find),

View file

@ -1109,7 +1109,7 @@ link_failed:
GST_DEBUG_OBJECT (play_bin,
"link failed when adding sink, caps %s, reason %d", capsstr, linkres);
g_free (capsstr);
g_free (caps);
gst_caps_unref (caps);
gst_element_set_state (sink, GST_STATE_NULL);
gst_bin_remove (GST_BIN (play_bin), sink);
@ -1127,7 +1127,7 @@ subtitle_failed:
"subtitle link failed when adding sink, caps %s, reason %d", capsstr,
linkres);
g_free (capsstr);
g_free (caps);
gst_caps_unref (caps);
return TRUE;
}

View file

@ -115,11 +115,14 @@ main (gint argc, gchar * argv[])
sinkpad = gst_element_get_pad (sink, "sink");
res = gst_pad_link (srcpad, sinkpad);
if (!res) {
GstCaps *caps;
gchar *capsstr;
capsstr = gst_caps_to_string (gst_pad_get_caps (srcpad));
caps = gst_pad_get_caps (srcpad);
capsstr = gst_caps_to_string (caps);
g_warning ("could not link %s", capsstr);
g_free (capsstr);
gst_caps_unref (caps);
}
//g_signal_emit_by_name (G_OBJECT (player), "link_stream", obj, sinkpad);
}

View file

@ -68,6 +68,7 @@ dump_element_stats (GstElement * element)
str = gst_caps_to_string (caps);
g_print (" caps: %s\n", str);
g_free (str);
gst_caps_unref (caps);
query = gst_query_new_duration (GST_FORMAT_TIME);
if (gst_pad_query (pad, query)) {

View file

@ -137,6 +137,7 @@ main (gint argc, gchar * argv[])
str = gst_caps_to_string (caps);
g_print (" caps: %s\n", str);
g_free (str);
gst_caps_unref (caps);
query = gst_query_new_duration (GST_FORMAT_TIME);
if (gst_pad_query (pad, query)) {