v4l2: bufferpool: Don't assert when orphaning is not needed
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 17 Apr 2023 20:05:35 +0000 (16:05 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 2 May 2023 14:42:43 +0000 (14:42 +0000)
This may happen when shutting down and should not cause
any harm. This removes the associated assert when shutting
down the pipeline, notably with CTRL+C.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4525>

subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c

index 3f28305..814a3a9 100644 (file)
@@ -1030,7 +1030,9 @@ gst_v4l2_buffer_pool_orphan (GstV4l2Object * v4l2object)
   GstV4l2BufferPool *pool;
   gboolean ret;
 
-  g_return_val_if_fail (bpool, FALSE);
+  /* Nothing to do if there is no pool */
+  if (!bpool)
+    return TRUE;
 
   pool = GST_V4L2_BUFFER_POOL (bpool);