Skip to content

Commit 35eede7

Browse files
committed
1 parent 3863fdb commit 35eede7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CollapseLauncher/Classes/Helper/Background/Loaders/MediaPlayerLoader.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,19 @@ private static async Task<StorageFile> GetFileAsStorageFile(string filePath)
327327

328328
private void FrameGrabberEvent(MediaPlayer mediaPlayer, object args)
329329
{
330+
if (_isCanvasCurrentlyDrawing == 1)
331+
{
332+
return;
333+
}
334+
330335
CanvasDrawingSession? drawingSession = null;
331336
try
332337
{
333338
Interlocked.Exchange(ref _isCanvasCurrentlyDrawing, 1);
334339
mediaPlayer.CopyFrameToVideoSurface(_currentCanvasBitmap);
335340
drawingSession = _currentCanvasVirtualImageSource?.CreateDrawingSession(_currentDefaultColor, _currentCanvasDrawArea);
336341
drawingSession?.DrawImage(_currentCanvasBitmap);
342+
_currentCanvasVirtualImageSource?.SuspendDrawingSession(drawingSession);
337343
}
338344
catch
339345
#if DEBUG

0 commit comments

Comments
 (0)