From 2e5367a23c34d93973fff71c5b66b31081068dab Mon Sep 17 00:00:00 2001 From: Scott D Phillips Date: Mon, 13 Jun 2016 10:48:41 -0700 Subject: [PATCH] plugins: retry pool config if gst_buffer_pool_set_config returns FALSE, check the modified config and retry set_config if the config is still acceptable. Signed-off-by: Scott D Phillips https://bugzilla.gnome.org/show_bug.cgi?id=766184 --- gst/vaapi/gstvaapipluginbase.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 389d69a99e..b74dbf4c3d 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -597,8 +597,18 @@ gst_vaapi_plugin_base_create_pool (GstVaapiPluginBase * plugin, GstCaps * caps, #endif if (allocator) gst_buffer_pool_config_set_allocator (config, allocator, NULL); - if (!gst_buffer_pool_set_config (pool, config)) - goto error_pool_config; + if (!gst_buffer_pool_set_config (pool, config)) { + config = gst_buffer_pool_get_config (pool); + + if (!gst_buffer_pool_config_validate_params (config, caps, size, + min_buffers, max_buffers)) { + gst_structure_free (config); + goto error_pool_config; + } + + if (!gst_buffer_pool_set_config (pool, config)) + goto error_pool_config; + } return pool; /* ERRORS */