v4l2bufferpool: Avoid set_flushing warning
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 26 Jun 2020 15:05:25 +0000 (11:05 -0400)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 26 Jun 2020 19:24:21 +0000 (19:24 +0000)
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/649>

sys/v4l2/gstv4l2bufferpool.c

index 5de5af2..5c42bb3 100644 (file)
@@ -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);