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
414 stars 94 forks source link

Snapshot frame is not refreshed on paused status #309

Closed ybbahg closed 2 months ago

ybbahg commented 3 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 3 months ago

Do you mean when calling TakeSnapshot() ?

ybbahg commented 3 months 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 2 months ago

Fixed with ed7ac59