summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2023-04-21 13:33:11 -0400
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-05-02 14:42:43 +0000
commitc93545f5b7e83e3de33f1ab6a74e5349530a20a9 (patch)
treefa97a81c464b331dc5dd8ae220cdbd14ecfca76e
parenta7581dc4d6c21f4c677fa594b5abab9de9ead5c1 (diff)
downloadgstreamer-c93545f5b7e83e3de33f1ab6a74e5349530a20a9.tar.gz
v4l2: videodec: Detect flushes while setting up the capture
As we missed the fact we were flushing, we could create and activate that buffer pool, and wait on it, causing a hang. We detect that we are flushing by checking the related pad state. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4525>
-rw-r--r--subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c
index b780d23e12..1d95b19599 100644
--- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c
+++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c
@@ -746,9 +746,17 @@ gst_v4l2_video_dec_loop (GstVideoDecoder * decoder)
goto beach;
}
+ GST_DEBUG_OBJECT (decoder, "Setup the capture queue");
ret = gst_v4l2_video_dec_setup_capture (decoder);
+ /* FIXME not super nice ? */
+ if (ret == GST_FLOW_FLUSHING || GST_PAD_IS_FLUSHING (decoder->sinkpad)
+ || GST_PAD_IS_FLUSHING (decoder->srcpad)) {
+ ret = GST_FLOW_FLUSHING;
+ GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
+ goto beach;
+ }
if (ret != GST_FLOW_OK) {
- GST_ERROR_OBJECT (decoder, "Failed setup capture queue");
+ GST_ERROR_OBJECT (decoder, "Failed to setup capture queue");
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
goto beach;
}