diff --git a/Source/Common/LinuxWrapper.cpp b/Source/Common/LinuxWrapper.cpp index 5b9950f0..1f2b8065 100644 --- a/Source/Common/LinuxWrapper.cpp +++ b/Source/Common/LinuxWrapper.cpp @@ -406,12 +406,13 @@ void LinuxWrapper::StartCaptureSession() do { FrameBufferLock.lock(); - if (Wrapper && !FrameBuffer.empty()) + if (!FrameBuffer.empty()) { - frame Cur = FrameBuffer.back(); + frame Cur = FrameBuffer.front(); FrameBuffer.pop(); - Wrapper->Parse_Buffer(Cur.Data, Cur.Size); + if (Wrapper) + Wrapper->Parse_Buffer(Cur.Data, Cur.Size); delete[] Cur.Data; } FrameBufferLock.unlock(); @@ -452,7 +453,7 @@ void LinuxWrapper::StopCaptureSession() FrameBufferLock.lock(); while (!FrameBuffer.empty()) { - delete[] FrameBuffer.back().Data; + delete[] FrameBuffer.front().Data; FrameBuffer.pop(); } FrameBufferLock.unlock();