mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 11:10:37 +00:00
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:
parent
8654829628
commit
7fd41c4263
2 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue