diff --git a/src/ui/Logic/VideoPlayers/Ffmpeg/FfmpegPlayer.cs b/src/ui/Logic/VideoPlayers/Ffmpeg/FfmpegPlayer.cs index fa70455f00..6481d267f9 100644 --- a/src/ui/Logic/VideoPlayers/Ffmpeg/FfmpegPlayer.cs +++ b/src/ui/Logic/VideoPlayers/Ffmpeg/FfmpegPlayer.cs @@ -801,6 +801,7 @@ private void VideoLoop() var swsSourceFormat = AVPixelFormat.AV_PIX_FMT_NONE; var outputWidth = 0; var outputHeight = 0; + VideoFrame? lastDropped = null; // detached from the queue while seeking; must be returned on every exit try { @@ -818,7 +819,6 @@ private void VideoLoop() var serial = -1; var dropUntil = -1.0; var presentedForSerial = false; - VideoFrame? lastDropped = null; // kept so a target past the last picture still shows something while (!_closing) { @@ -988,6 +988,8 @@ private void VideoLoop() } finally { + _videoFrames.Return(lastDropped); + if (sws != null) { ffmpeg.sws_freeContext(sws);