From bd5338ff31781dd55127d534b1e30a360273841b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 30 Jan 2007 19:12:54 +0000 Subject: [PATCH] plugins/elements/gsttypefindelement.c: Don't leak found caps in chain function (no idea why that never showed up as a... Original commit message from CVS: * plugins/elements/gsttypefindelement.c: (gst_type_find_element_chain_do_typefinding), (gst_type_find_element_change_state): Don't leak found caps in chain function (no idea why that never showed up as a leak anywhere). --- ChangeLog | 8 ++++++++ plugins/elements/gsttypefindelement.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7376664e2e..a07d35d52c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-01-30 Tim-Philipp Müller + + * plugins/elements/gsttypefindelement.c: + (gst_type_find_element_chain_do_typefinding), + (gst_type_find_element_change_state): + Don't leak found caps in chain function (no idea why that never + showed up as a leak anywhere). + 2007-01-30 Stefan Kost * gst/gstplugin.h: diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index e0790c4926..658ce09315 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -620,6 +620,8 @@ gst_type_find_element_chain_do_typefinding (GstTypeFindElement * typefind) "probability is %u which is lower than the required minimum of %u", caps, probability, typefind->min_probability); + gst_caps_replace (&caps, NULL); + if (GST_BUFFER_SIZE (typefind->store) >= TYPE_FIND_MAX_SIZE) { GST_ELEMENT_ERROR (typefind, STREAM, TYPE_NOT_FOUND, (NULL), (NULL)); stop_typefinding (typefind); @@ -636,6 +638,7 @@ gst_type_find_element_chain_do_typefinding (GstTypeFindElement * typefind) /* .. and send out the accumulated data */ stop_typefinding (typefind); + gst_caps_unref (caps); return GST_FLOW_OK; } @@ -768,6 +771,7 @@ gst_type_find_element_change_state (GstElement * element, switch (transition) { case GST_STATE_CHANGE_PAUSED_TO_READY: + case GST_STATE_CHANGE_READY_TO_NULL: gst_caps_replace (&typefind->caps, NULL); g_list_foreach (typefind->cached_events, (GFunc) gst_mini_object_unref, NULL);