From: Nicolas Dufresne Date: Tue, 14 Mar 2023 18:27:39 +0000 (-0400) Subject: avviddec: Drop decoder stream lock when calling send_packet X-Git-Tag: 1.22.7~417 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07ba258eadc289ffcaad1d6d31cac88b43a58a53;p=platform%2Fupstream%2Fgstreamer.git avviddec: Drop decoder stream lock when calling send_packet This is already done for every other calls to send_packet. The deadlock occures since FFMPeg 6.0. The decoder tries to get a buffer from a thread during the draining process, and blocks trying to get the video decoder stream lock already heald by the drain function. Fixes #2383 Part-of: --- diff --git a/subprojects/gst-libav/ext/libav/gstavviddec.c b/subprojects/gst-libav/ext/libav/gstavviddec.c index 336da5b..ff38742 100644 --- a/subprojects/gst-libav/ext/libav/gstavviddec.c +++ b/subprojects/gst-libav/ext/libav/gstavviddec.c @@ -2042,8 +2042,12 @@ gst_ffmpegviddec_drain (GstVideoDecoder * decoder) if (!ffmpegdec->opened) return GST_FLOW_OK; - if (avcodec_send_packet (ffmpegdec->context, NULL)) + GST_VIDEO_DECODER_STREAM_UNLOCK (ffmpegdec); + if (avcodec_send_packet (ffmpegdec->context, NULL)) { + GST_VIDEO_DECODER_STREAM_LOCK (ffmpegdec); goto send_packet_failed; + } + GST_VIDEO_DECODER_STREAM_LOCK (ffmpegdec); do { got_frame = gst_ffmpegviddec_frame (ffmpegdec, NULL, &ret);