Commit e45b1fd9 authored by Nicolas Dufresne's avatar Nicolas Dufresne
Browse files

v4l2object: Don't leak config structure

this fixes a leak of the config structure and take care of making sure
caps can't reach ref 0 before we are done doing our check.

CID 1212144
parent 5284aca5
...@@ -2952,16 +2952,21 @@ gst_v4l2_object_set_crop (GstV4l2Object * obj) ...@@ -2952,16 +2952,21 @@ gst_v4l2_object_set_crop (GstV4l2Object * obj)
gboolean gboolean
gst_v4l2_object_caps_equal (GstV4l2Object * v4l2object, GstCaps * caps) gst_v4l2_object_caps_equal (GstV4l2Object * v4l2object, GstCaps * caps)
{ {
GstStructure *s; GstStructure *config;
GstCaps *oldcaps; GstCaps *oldcaps;
gboolean ret;
if (!v4l2object->pool) if (!v4l2object->pool)
return FALSE; return FALSE;
s = gst_buffer_pool_get_config (GST_BUFFER_POOL_CAST (v4l2object->pool)); config = gst_buffer_pool_get_config (v4l2object->pool);
gst_buffer_pool_config_get_params (s, &oldcaps, NULL, NULL, NULL); gst_buffer_pool_config_get_params (config, &oldcaps, NULL, NULL, NULL);
return oldcaps && gst_caps_is_equal (caps, oldcaps); ret = oldcaps && gst_caps_is_equal (caps, oldcaps);
gst_structure_free (config);
return ret;
} }
gboolean gboolean
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