Commit ab22f339 authored by Thibault Saunier's avatar Thibault Saunier 🌵
Browse files

track: Set restriction caps when update_restriction before caps being set

And stop leaking intermediary restriction caps.

https://bugzilla.gnome.org/show_bug.cgi?id=796802
parent a3c17343
......@@ -850,8 +850,16 @@ void
ges_track_update_restriction_caps (GESTrack * self, const GstCaps * caps)
{
guint i;
GstCaps *new_restriction_caps = gst_caps_copy (self->priv->restriction_caps);
GstCaps *new_restriction_caps;
g_return_if_fail (GES_IS_TRACK (self));
if (!self->priv->restriction_caps) {
ges_track_set_restriction_caps (self, caps);
return;
}
new_restriction_caps = gst_caps_copy (self->priv->restriction_caps);
for (i = 0; i < gst_caps_get_size (caps); i++) {
GstStructure *new = gst_caps_get_structure (caps, i);
......@@ -865,6 +873,7 @@ ges_track_update_restriction_caps (GESTrack * self, const GstCaps * caps)
}
ges_track_set_restriction_caps (self, new_restriction_caps);
gst_caps_unref (new_restriction_caps);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment