typefind: don't leak the force-caps property

Fixes #581321
This commit is contained in:
Arnout Vandecappelle 2009-05-05 17:41:24 +02:00 committed by Wim Taymans
parent 8c26c22f2c
commit ef9ad30fde

View file

@ -235,6 +235,7 @@ gst_type_find_element_class_init (GstTypeFindElementClass * typefind_class)
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
}
static void
gst_type_find_element_init (GstTypeFindElement * typefind,
GstTypeFindElementClass * g_class)
@ -278,6 +279,7 @@ gst_type_find_element_init (GstTypeFindElement * typefind,
typefind->store = NULL;
}
static void
gst_type_find_element_dispose (GObject * object)
{
@ -287,6 +289,10 @@ gst_type_find_element_dispose (GObject * object)
gst_buffer_unref (typefind->store);
typefind->store = NULL;
}
if (typefind->force_caps) {
gst_caps_unref (typefind->force_caps);
typefind->force_caps = NULL;
}
G_OBJECT_CLASS (parent_class)->dispose (object);
}
@ -318,6 +324,7 @@ gst_type_find_element_set_property (GObject * object, guint prop_id,
break;
}
}
static void
gst_type_find_element_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
@ -607,8 +614,8 @@ gst_type_find_element_setcaps (GstPad * pad, GstCaps * caps)
}
static GstCaps *
gst_type_find_guess_by_extension (GstTypeFindElement *typefind, GstPad *pad,
GstTypeFindProbability *probability)
gst_type_find_guess_by_extension (GstTypeFindElement * typefind, GstPad * pad,
GstTypeFindProbability * probability)
{
GstQuery *query;
gchar *uri;
@ -640,9 +647,11 @@ gst_type_find_guess_by_extension (GstTypeFindElement *typefind, GstPad *pad,
if (find < 0)
goto no_extension;
GST_DEBUG_OBJECT (typefind, "found extension %s", &uri[find+1]);
GST_DEBUG_OBJECT (typefind, "found extension %s", &uri[find + 1]);
caps = gst_type_find_helper_for_extension (GST_OBJECT_CAST (typefind), &uri[find+1]);
caps =
gst_type_find_helper_for_extension (GST_OBJECT_CAST (typefind),
&uri[find + 1]);
if (caps)
*probability = GST_TYPE_FIND_MAXIMUM;