From 95a3270c71a8395cb7261f7bce15d3263f8d164f Mon Sep 17 00:00:00 2001 From: Hou Qi Date: Tue, 15 Mar 2022 09:49:59 +0800 Subject: [PATCH] v4l2videodec: safely retrun from video_dec_loop with stream unlock This is to avoid decoder hang when doing trick play between different resolutions. Change-Id: I5731d6f7f587955fd4c5ffd07e1bc57404f10b23 Part-of: --- subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c index 1cecac8..b80e672 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c @@ -734,8 +734,10 @@ gst_v4l2_video_dec_loop (GstVideoDecoder * decoder) if (g_atomic_int_get (&self->capture_configuration_change)) { gst_v4l2_object_stop (self->v4l2capture); ret = gst_v4l2_video_dec_setup_capture (decoder); - if (ret != GST_FLOW_OK) + if (ret != GST_FLOW_OK) { + GST_VIDEO_DECODER_STREAM_UNLOCK (decoder); return; + } g_atomic_int_set (&self->capture_configuration_change, FALSE); } GST_VIDEO_DECODER_STREAM_UNLOCK (decoder); -- 2.7.4