From cbdb4e81f6d4d3a05e4d415fa050d2e648516525 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 22 Oct 2024 08:01:41 -0600 Subject: [PATCH] [cscore] GetNextFrame: Wake up even if no frames received (#7244) --- cscore/src/main/native/cpp/SourceImpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cscore/src/main/native/cpp/SourceImpl.cpp b/cscore/src/main/native/cpp/SourceImpl.cpp index 6bdee5bab9..f2cc0d8ccc 100644 --- a/cscore/src/main/native/cpp/SourceImpl.cpp +++ b/cscore/src/main/native/cpp/SourceImpl.cpp @@ -79,7 +79,8 @@ Frame SourceImpl::GetCurFrame() { Frame SourceImpl::GetNextFrame() { std::unique_lock lock{m_frameMutex}; auto oldTime = m_frame.GetTime(); - m_frameCv.wait(lock, [=, this] { return m_frame.GetTime() != oldTime; }); + m_frameCv.wait( + lock, [=, this] { return oldTime == 0 || m_frame.GetTime() != oldTime; }); return m_frame; }