v4l2: videodec: Don't wait for src_ch if active
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 26 Jun 2023 21:10:33 +0000 (17:10 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 9 Jul 2023 16:50:30 +0000 (17:50 +0100)
If the capture pool is already active, like when handling gaps at the
start of a stream, do not setup the decoder to wait for src_ch event.
Otherwise the decoder will endup waiting for that at the wrong moment
and exit the decoding thread unexpectedly.

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

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

index 61e0330..3019a09 100644 (file)
@@ -974,7 +974,8 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
     gst_buffer_unref (codec_data);
 
     /* Only wait for source change if the formats supports it */
-    if (self->v4l2output->fmtdesc->flags & V4L2_FMT_FLAG_DYN_RESOLUTION) {
+    if (!GST_V4L2_IS_ACTIVE (self->v4l2capture) &&
+        self->v4l2output->fmtdesc->flags & V4L2_FMT_FLAG_DYN_RESOLUTION) {
       gst_v4l2_object_unlock_stop (self->v4l2capture);
       self->wait_for_source_change = TRUE;
     }