mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
avviddec: Unlock stream lock while waiting for decoded frame
FFmpeg might request buffer from other threads, it will result in deadlock Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2558 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5681>
This commit is contained in:
parent
de92a6c7f2
commit
d2c9200828
1 changed files with 4 additions and 0 deletions
|
@ -1779,7 +1779,11 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec,
|
||||||
* else we might skip a reference frame */
|
* else we might skip a reference frame */
|
||||||
gst_ffmpegviddec_do_qos (ffmpegdec, frame, &mode_switch);
|
gst_ffmpegviddec_do_qos (ffmpegdec, frame, &mode_switch);
|
||||||
|
|
||||||
|
/* FFmpeg might request new buffer from other threads.
|
||||||
|
* Release lock here */
|
||||||
|
GST_VIDEO_DECODER_STREAM_UNLOCK (ffmpegdec);
|
||||||
res = avcodec_receive_frame (ffmpegdec->context, ffmpegdec->picture);
|
res = avcodec_receive_frame (ffmpegdec->context, ffmpegdec->picture);
|
||||||
|
GST_VIDEO_DECODER_STREAM_LOCK (ffmpegdec);
|
||||||
|
|
||||||
/* No frames available at this time */
|
/* No frames available at this time */
|
||||||
if (res == AVERROR (EAGAIN)) {
|
if (res == AVERROR (EAGAIN)) {
|
||||||
|
|
Loading…
Reference in a new issue