Commit 868984b4 authored by Stefan Kost's avatar Stefan Kost
Browse files

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
parent bc510bf9
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> 2006-05-01 Tim-Philipp Müller <tim at centricular dot net>
   
* gst/typefind/gsttypefindfunctions.c: (musepack_type_find), * gst/typefind/gsttypefindfunctions.c: (musepack_type_find),
......
...@@ -1109,7 +1109,7 @@ link_failed: ...@@ -1109,7 +1109,7 @@ link_failed:
GST_DEBUG_OBJECT (play_bin, GST_DEBUG_OBJECT (play_bin,
"link failed when adding sink, caps %s, reason %d", capsstr, linkres); "link failed when adding sink, caps %s, reason %d", capsstr, linkres);
g_free (capsstr); g_free (capsstr);
g_free (caps); gst_caps_unref (caps);
gst_element_set_state (sink, GST_STATE_NULL); gst_element_set_state (sink, GST_STATE_NULL);
gst_bin_remove (GST_BIN (play_bin), sink); gst_bin_remove (GST_BIN (play_bin), sink);
...@@ -1127,7 +1127,7 @@ subtitle_failed: ...@@ -1127,7 +1127,7 @@ subtitle_failed:
"subtitle link failed when adding sink, caps %s, reason %d", capsstr, "subtitle link failed when adding sink, caps %s, reason %d", capsstr,
linkres); linkres);
g_free (capsstr); g_free (capsstr);
g_free (caps); gst_caps_unref (caps);
return TRUE; return TRUE;
} }
......
...@@ -115,11 +115,14 @@ main (gint argc, gchar * argv[]) ...@@ -115,11 +115,14 @@ main (gint argc, gchar * argv[])
sinkpad = gst_element_get_pad (sink, "sink"); sinkpad = gst_element_get_pad (sink, "sink");
res = gst_pad_link (srcpad, sinkpad); res = gst_pad_link (srcpad, sinkpad);
if (!res) { if (!res) {
GstCaps *caps;
gchar *capsstr; 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_warning ("could not link %s", capsstr);
g_free (capsstr); g_free (capsstr);
gst_caps_unref (caps);
} }
//g_signal_emit_by_name (G_OBJECT (player), "link_stream", obj, sinkpad); //g_signal_emit_by_name (G_OBJECT (player), "link_stream", obj, sinkpad);
} }
......
...@@ -68,6 +68,7 @@ dump_element_stats (GstElement * element) ...@@ -68,6 +68,7 @@ dump_element_stats (GstElement * element)
str = gst_caps_to_string (caps); str = gst_caps_to_string (caps);
g_print (" caps: %s\n", str); g_print (" caps: %s\n", str);
g_free (str); g_free (str);
gst_caps_unref (caps);
query = gst_query_new_duration (GST_FORMAT_TIME); query = gst_query_new_duration (GST_FORMAT_TIME);
if (gst_pad_query (pad, query)) { if (gst_pad_query (pad, query)) {
......
...@@ -137,6 +137,7 @@ main (gint argc, gchar * argv[]) ...@@ -137,6 +137,7 @@ main (gint argc, gchar * argv[])
str = gst_caps_to_string (caps); str = gst_caps_to_string (caps);
g_print (" caps: %s\n", str); g_print (" caps: %s\n", str);
g_free (str); g_free (str);
gst_caps_unref (caps);
query = gst_query_new_duration (GST_FORMAT_TIME); query = gst_query_new_duration (GST_FORMAT_TIME);
if (gst_pad_query (pad, query)) { if (gst_pad_query (pad, query)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment