From 7fd41c42639d0603015bf467d9fb8b1eef15c078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 18 Jan 2017 17:20:21 +0100 Subject: [PATCH] plugins: avoid log flood when activating pool Every time a new buffer is allocated, the pool is activated. This doesn't impact in performance since gst_buffer_pool_set_active() checks the current state of the pool. Nonetheless it logs out a message if the state is the same, and it floods the logging subsystem if it is enabled. To avoid this log flooding first the pool state is checked before changing it. --- gst/vaapi/gstvaapipluginbase.c | 3 ++- gst/vaapi/gstvaapipostproc.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 7e7a4438e4..d37300e680 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -989,7 +989,8 @@ gst_vaapi_plugin_base_get_input_buffer (GstVaapiPluginBase * plugin, if (!plugin->sinkpad_buffer_pool) goto error_no_pool; - if (!gst_buffer_pool_set_active (plugin->sinkpad_buffer_pool, TRUE)) + if (!gst_buffer_pool_is_active (plugin->sinkpad_buffer_pool) && + !gst_buffer_pool_set_active (plugin->sinkpad_buffer_pool, TRUE)) goto error_active_pool; outbuf = NULL; diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index e2afea8c8d..d59496af05 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -362,7 +362,8 @@ create_output_buffer (GstVaapiPostproc * postproc) g_return_val_if_fail (pool != NULL, NULL); - if (!gst_buffer_pool_set_active (pool, TRUE)) + if (!gst_buffer_pool_is_active (pool) && + !gst_buffer_pool_set_active (pool, TRUE)) goto error_activate_pool; outbuf = NULL;