gst_pad_get_pad_template_caps() returns a reference which is unreferenced,
so creating a copy using gst_caps_copy() results in a reference leak. Also
the caps are pushed as an event downstream, but this doesn't consume the
caps so it must still be unreferenced.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734534
return TRUE;
}
- caps = gst_caps_copy (gst_pad_get_pad_template_caps (self->srcpad));
+ caps = gst_pad_get_pad_template_caps (self->srcpad);
+ caps = gst_caps_make_writable (caps);
s = gst_caps_get_structure (caps, 0);
gst_structure_set (s,
"width", G_TYPE_INT, self->negotiated_width,
}
result = gst_pad_push_event (self->srcpad, gst_event_new_caps (caps));
+ gst_caps_unref (caps);
self->caps_width = self->negotiated_width;
self->caps_height = self->negotiated_height;