GNOME Bugzilla – Bug 693307
videomixer2 leaks caps reference
Last modified: 2013-02-07 10:41:46 UTC
Created attachment 235373 [details] [review] Memory leak fix. static gboolean gst_videomixer2_query_caps (GstPad * pad, GstObject * parent, GstQuery * query) { GstCaps *filter, *caps; GstVideoMixer2 *mix = GST_VIDEO_MIXER2 (parent); GstStructure *s; gint n; gst_query_parse_caps (query, &filter); if (GST_VIDEO_INFO_FORMAT (&mix->info) != GST_VIDEO_FORMAT_UNKNOWN) { caps = gst_pad_get_current_caps (mix->srcpad); } else { caps = gst_pad_get_pad_template_caps (mix->srcpad); } caps = gst_caps_make_writable (caps); n = gst_caps_get_size (caps) - 1; for (; n >= 0; n--) { s = gst_caps_get_structure (caps, n); gst_structure_set (s, "width", GST_TYPE_INT_RANGE, 1, G_MAXINT, "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL); if (GST_VIDEO_INFO_FPS_D (&mix->info) != 0) { gst_structure_set (s, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); } } gst_query_set_caps_result (query, caps); return TRUE; }
commit 3a5d17e852ae2d1b227d9c54a96494327a8b9976 Author: Tim 'mithro' Ansell <gnome at mithis.com> Date: Thu Feb 7 11:40:35 2013 +0100 videomixer2: avoid caps leak Fixes https://bugzilla.gnome.org/show_bug.cgi?id=693307