From 8750aea364b624941aadfa7730227fb47ec5eb65 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 18 Jul 2011 16:48:25 +0200 Subject: [PATCH] x11: improve allocation parameters Set the min-buffers to 2 because our base class will hold on to 1 buffer for the last-buffer property. --- sys/ximage/ximagesink.c | 3 ++- sys/xvimage/xvimagesink.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 00c3817..0a3a64f 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -1482,7 +1482,8 @@ gst_ximagesink_sink_query (GstPad * sinkpad, GstQuery * query) if (!gst_buffer_pool_set_config (pool, config)) goto config_failed; } - gst_query_set_allocation_params (query, size, 0, 0, 0, 15, pool); + /* we need at least 2 buffer because we hold on to the last one */ + gst_query_set_allocation_params (query, size, 2, 0, 0, 15, pool); /* we also support various metadata */ gst_query_add_allocation_meta (query, GST_META_API_VIDEO); diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 1b12cf3..2d2384f 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1996,7 +1996,8 @@ gst_xvimagesink_sink_query (GstPad * sinkpad, GstQuery * query) if (!gst_buffer_pool_set_config (pool, config)) goto config_failed; } - gst_query_set_allocation_params (query, size, 0, 0, 0, 15, pool); + /* we need at least 2 buffer because we hold on to the last one */ + gst_query_set_allocation_params (query, size, 2, 0, 0, 15, pool); /* we also support various metadata */ gst_query_add_allocation_meta (query, GST_META_API_VIDEO); -- 2.7.4