gst_query_set_nth_allocation_pool() requires there to be a pool in the
query already. This is not always the case when we get the query from
upstream. Use gst_query_add_allocation_pool() instead in such case.
https://bugzilla.gnome.org/show_bug.cgi?id=681719
GstAllocationParams params;
GstStructure *config;
gboolean update_allocator;
GstAllocationParams params;
GstStructure *config;
gboolean update_allocator;
gst_query_parse_allocation (query, &outcaps, NULL);
gst_query_parse_allocation (query, &outcaps, NULL);
if (gst_query_get_n_allocation_pools (query) > 0) {
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
if (gst_query_get_n_allocation_pools (query) > 0) {
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
} else {
pool = NULL;
size = GST_VIDEO_INFO_SIZE (&scope->vinfo);
min = max = 0;
} else {
pool = NULL;
size = GST_VIDEO_INFO_SIZE (&scope->vinfo);
min = max = 0;
if (allocator)
gst_object_unref (allocator);
if (allocator)
gst_object_unref (allocator);
gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max);
gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max);
+ else
+ gst_query_add_allocation_pool (query, pool, size, min, max);
+
+ if (pool)