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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4187>
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);