From b8f1f2195ec7ef5f930a4b0bf66ce484ca21d5fa Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Fri, 26 Jun 2020 11:05:25 -0400 Subject: [PATCH] v4l2bufferpool: Avoid set_flushing warning The gst_buffer_pool_set_flushing() warns when that function is called on an inactive pool. Avoid the warning by checking the state, this is similar to what we do in gst_v4l2_object_unlock(). Part-of: --- sys/v4l2/gstv4l2bufferpool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 5de5af2..5c42bb3 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -1034,7 +1034,7 @@ gst_v4l2_buffer_pool_flush_start (GstBufferPool * bpool) g_cond_broadcast (&pool->empty_cond); GST_OBJECT_UNLOCK (pool); - if (pool->other_pool) + if (pool->other_pool && gst_buffer_pool_is_active (pool->other_pool)) gst_buffer_pool_set_flushing (pool->other_pool, TRUE); } @@ -1045,7 +1045,7 @@ gst_v4l2_buffer_pool_flush_stop (GstBufferPool * bpool) GST_DEBUG_OBJECT (pool, "stop flushing"); - if (pool->other_pool) + if (pool->other_pool && gst_buffer_pool_is_active (pool->other_pool)) gst_buffer_pool_set_flushing (pool->other_pool, FALSE); gst_poll_set_flushing (pool->poll, FALSE); -- 2.7.4