From 9220edce2b0bdd46c3b8bddf6801cab05b146f2c Mon Sep 17 00:00:00 2001 From: Good Guy Date: Tue, 18 Mar 2025 09:58:42 -0600 Subject: [PATCH] Credit Andrew -improve screencapture speed so it does not fallback to non-shm capture --- cinelerra-5.1/guicast/bccapture.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cinelerra-5.1/guicast/bccapture.C b/cinelerra-5.1/guicast/bccapture.C index d8a55590..a3488898 100644 --- a/cinelerra-5.1/guicast/bccapture.C +++ b/cinelerra-5.1/guicast/bccapture.C @@ -167,7 +167,7 @@ int BC_Capture::allocate_data() // Crashes here if remote server. BC_Resources::error = 0; - XShmAttach(display, &shm_info); + use_shm = XShmAttach(display, &shm_info); XSync(display, False); if( BC_Resources::error ) { XDestroyImage(ximage); @@ -236,7 +236,7 @@ int BC_Capture::capture_frame(VFrame *frame, int &x1, int &y1, // Read the raw data if( use_shm ) - XShmGetImage(display, rootwin, ximage, x1, y1, 0xffffffff); + use_shm = XShmGetImage(display, rootwin, ximage, x1, y1, 0xffffffff); else XGetSubImage(display, rootwin, x1, y1, w, h, 0xffffffff, ZPixmap, ximage, 0, 0); -- 2.26.2