Credit Andrew -improve screencapture speed so it does not fallback to non-shm capture master
authorGood Guy <good1.2guy@gmail.com>
Tue, 18 Mar 2025 15:58:42 +0000 (09:58 -0600)
committerGood Guy <good1.2guy@gmail.com>
Tue, 18 Mar 2025 15:58:42 +0000 (09:58 -0600)
cinelerra-5.1/guicast/bccapture.C

index d8a555906a7bd505ea9249c70774c8a844860ca4..a3488898432cb897c33853fa325dd69ef5f77b17 100644 (file)
@@ -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);