From be33cecbbb7fe50d2baece7ba7427ed87167dfb5 Mon Sep 17 00:00:00 2001 From: skyjet18 <57456827+skyjet18@users.noreply.github.com> Date: Tue, 24 Jan 2023 20:57:12 +0100 Subject: [PATCH] =?UTF-8?q?release=C2=A0mutex=C2=A0when=C2=A0waiting=C2=A0?= =?UTF-8?q?for=C2=A0new=C2=A0frame?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libeplayer3/container/container_ffmpeg.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libeplayer3/container/container_ffmpeg.c b/libeplayer3/container/container_ffmpeg.c index 74274f3..b450125 100644 --- a/libeplayer3/container/container_ffmpeg.c +++ b/libeplayer3/container/container_ffmpeg.c @@ -780,7 +780,19 @@ static void FFMPEGThread(Context_t *context) } } - if (!isWaitingForFinish && (ffmpegStatus = av_read_frame(avContextTab[cAVIdx], &packet)) == 0) + if (bufferSize > 0) + { + LinuxDvbBuffSetStamp(stamp); + } + + if (!isWaitingForFinish) + { + releaseMutex(__FILE__, __FUNCTION__, __LINE__); + ffmpegStatus = av_read_frame(avContextTab[cAVIdx], &packet); + getMutex(__FILE__, __FUNCTION__, __LINE__); + } + + if (!isWaitingForFinish && (ffmpegStatus == 0)) { int64_t pts = 0; int64_t dts = 0;