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.
This commit is contained in:
Víctor Manuel Jáquez Leal 2017-01-18 17:20:21 +01:00
parent 8654829628
commit 7fd41c4263
2 changed files with 4 additions and 2 deletions

View file

@ -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;

View file

@ -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;