aiffparse: don't leak adapter

This commit is contained in:
Tim-Philipp Müller 2013-08-17 00:23:08 +01:00
parent ddcfe3ddf3
commit 63d629aba5

View file

@ -1645,13 +1645,17 @@ gst_aiff_parse_sink_activate_mode (GstPad * sinkpad, GstObject * parent,
gboolean res; gboolean res;
GstAiffParse *aiff = GST_AIFF_PARSE (parent); GstAiffParse *aiff = GST_AIFF_PARSE (parent);
if (aiff->adapter) if (aiff->adapter) {
g_object_unref (aiff->adapter); g_object_unref (aiff->adapter);
aiff->adapter = NULL;
}
switch (mode) { switch (mode) {
case GST_PAD_MODE_PUSH: case GST_PAD_MODE_PUSH:
aiff->streaming = TRUE; if (active) {
aiff->adapter = gst_adapter_new (); aiff->streaming = TRUE;
aiff->adapter = gst_adapter_new ();
}
res = TRUE; res = TRUE;
break; break;
case GST_PAD_MODE_PULL: case GST_PAD_MODE_PULL: