Don't leak temporary GStreamer caps

This commit is contained in:
trav90
2016-03-28 12:13:13 -05:00
committed by roytam1
parent 0acf3300c6
commit 4738e5cc69
@@ -279,7 +279,11 @@ static bool SupportsCaps(GstElementFactory *aFactory, GstCaps *aCaps)
continue;
}
if (gst_caps_can_intersect(gst_static_caps_get(&templ->static_caps), aCaps)) {
bool supported = gst_caps_can_intersect(caps, aCaps);
gst_caps_unref(caps);
if (supported) {
return true;
}
}
@@ -307,11 +311,11 @@ bool GStreamerFormatHelper::HaveElementsToProcessCaps(GstCaps* aCaps) {
}
}
gst_caps_unref(caps);
if (!found) {
return false;
}
gst_caps_unref(caps);
}
return true;