From b30dee98e694f0977192441a969e610b4adb15ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Wed, 23 Nov 2016 12:17:55 -0500 Subject: [PATCH] v4l2sink: Block in preroll_wait on unlock The correct behaviour of anything stuck in the ->render() function between ->unlock() and ->unlock_stop() is to call gst_base_sink_wait_preroll() and only return an error if this returns an error, otherwise, it must continue where it left off! https://bugzilla.gnome.org/show_bug.cgi?id=774945 --- sys/v4l2/gstv4l2sink.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c index 1d457b5..3295947 100644 --- a/sys/v4l2/gstv4l2sink.c +++ b/sys/v4l2/gstv4l2sink.c @@ -603,8 +603,16 @@ gst_v4l2sink_show_frame (GstVideoSink * vsink, GstBuffer * buf) goto activate_failed; } + gst_buffer_ref (buf); +again: ret = gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL_CAST (obj->pool), &buf); + if (ret == GST_FLOW_FLUSHING) { + ret = gst_base_sink_wait_preroll (GST_BASE_SINK (vsink)); + if (ret == GST_FLOW_OK) + goto again; + } + gst_buffer_unref (buf); return ret; -- 2.7.4