From 36b7146d7f9e95bae0fb718f5bd0365de1282078 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 12 Nov 2021 23:48:12 +0100 Subject: [PATCH] Made the video player shut down slightly faster under some circumstances. --- es-core/src/components/VideoFFmpegComponent.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/es-core/src/components/VideoFFmpegComponent.cpp b/es-core/src/components/VideoFFmpegComponent.cpp index d59d5bf74..3cbf4bbf0 100644 --- a/es-core/src/components/VideoFFmpegComponent.cpp +++ b/es-core/src/components/VideoFFmpegComponent.cpp @@ -264,7 +264,11 @@ void VideoFFmpegComponent::frameProcessing() while (mIsPlaying && !mPause && videoFilter && (!mAudioCodecContext || audioFilter)) { readFrames(); + if (!mIsPlaying) + break; getProcessedFrames(); + if (!mIsPlaying) + break; outputFrames(); // This 1 ms wait makes sure that the thread does not consume all available CPU cycles.