Fix leak of caps event and of caps objects when setting caps on sink and src
pads. Sync audiovisualizer class implementation to the one in gst-plugins-bad.
This commit matches
c5ef1bee7318f057aa1f542d5a1474b75e85131a in that module.
https://bugzilla.gnome.org/show_bug.cgi?id=742875
/* find a pool for the negotiated caps now */
res = gst_audio_visualizer_do_bufferpool (scope, caps);
+ gst_caps_unref (caps);
return res;
/* ERRORS */
wrong_caps:
{
+ gst_caps_unref (caps);
GST_DEBUG_OBJECT (scope, "error parsing caps");
return FALSE;
}
gst_event_parse_caps (event, &caps);
res = gst_audio_visualizer_sink_setcaps (scope, caps);
+ gst_event_unref (event);
break;
}
case GST_EVENT_FLUSH_STOP: