sskodje / ScreenRecorderLib

A .NET library for screen recording in Windows, using native Microsoft Media Foundation for realtime encoding to h264 video or PNG images.
MIT License
408 stars 93 forks source link

Snapshot frame is not refreshed on paused status #309

Closed ybbahg closed 1 month ago

ybbahg commented 2 months ago

Hello Current recorder loop checks m_IsPaused value before AcquireNextFrame so when we take screenshot on paused status, captured frame is old one I suggest check m_IsPaused value 'after' AcquireNextFrame to refresh current captured frame thanks

sskodje commented 1 month ago

Do you mean when calling TakeSnapshot() ?

ybbahg commented 1 month ago

@sskodje Yes you're right.

Try take snap shot when recording is paused Current Master branch returns the frame caught right before pause

When we call RecordingManager::TakeSnapshot() ScreenCaptureManager::CopyCurrentFrame() copies from m_FrameCopy So I think m_FrameCopy should be updated in ScreenCaptureManager::AcquireNextFrame() but this method is not called when m_IsPaused==true

thanks

sskodje commented 1 month ago

Fixed with ed7ac59