rfbsrc: Fix decide_allocation to support NULL pool

We were assuming that NULL pool meant that downstream didn't reply.
Update the pool index 0 instead of adding at the end. Otherwise we ended
up letting basesrc decide, which would pick the blocksize as a size
(4096) instead of the image size.

https://bugzilla.gnome.org/show_bug.cgi?id=795327
This commit is contained in:
Nicolas Dufresne 2018-04-25 15:05:38 -04:00
parent 5d1efe7f55
commit ede8b1c8ce

View file

@ -372,7 +372,11 @@ gst_rfb_src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query)
size = info.size;
min = 1;
max = 0;
gst_query_add_allocation_pool (query, pool, size, min, max);
if (gst_query_get_n_allocation_pools (query) > 0)
gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max);
else
gst_query_add_allocation_pool (query, pool, size, min, max);
}
config = gst_buffer_pool_get_config (pool);