diff --git a/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp b/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp index 13ea90d7..2686c549 100644 --- a/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp +++ b/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp @@ -47,6 +47,7 @@ Pacer::~Pacer() // Stop the V-sync thread if (m_VsyncThread != nullptr) { + m_PacingQueueNotEmpty.wakeAll(); m_VsyncSignalled.wakeAll(); SDL_WaitThread(m_VsyncThread, nullptr); } @@ -244,6 +245,11 @@ void Pacer::handleVsync(int timeUntilNextVsyncMillis) m_FrameQueueLock.unlock(); return; } + + if (m_Stopping) { + m_FrameQueueLock.unlock(); + return; + } } // Place the first frame on the render queue