omxvideodec: unref allocator after getting it from allocation query

Otherwise a reference will be leaked for each allocator. It only happens
when target platform is Raspberry Pi and when we have GL support.

https://bugzilla.gnome.org/show_bug.cgi?id=751867
This commit is contained in:
Aurélien Zanelli 2015-07-03 00:26:48 +02:00 committed by Sebastian Dröge
parent 461c7db44b
commit d2df0fb032

View file

@ -2530,14 +2530,18 @@ gst_omx_video_dec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
GstAllocationParams params; GstAllocationParams params;
gst_query_parse_nth_allocation_param (query, i, &allocator, &params); gst_query_parse_nth_allocation_param (query, i, &allocator, &params);
if (allocator if (allocator) {
&& g_strcmp0 (allocator->mem_type, if (g_strcmp0 (allocator->mem_type, GST_EGL_IMAGE_MEMORY_TYPE) == 0) {
GST_EGL_IMAGE_MEMORY_TYPE) == 0) { found = TRUE;
found = TRUE; gst_query_set_nth_allocation_param (query, 0, allocator, &params);
gst_query_set_nth_allocation_param (query, 0, allocator, &params); while (gst_query_get_n_allocation_params (query) > 1)
while (gst_query_get_n_allocation_params (query) > 1) gst_query_remove_nth_allocation_param (query, 1);
gst_query_remove_nth_allocation_param (query, 1); }
break;
gst_object_unref (allocator);
if (found)
break;
} }
} }