aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-05-30 01:28:59 +0200
committerdec05eba <dec05eba@protonmail.com>2024-05-30 01:28:59 +0200
commita3f6864572f5fffd5e4debffe3e6beea146440b3 (patch)
tree3a265d1988224e4f1d1a0c8cbc7b9e267b57a6c5
parentcd777c1506e20514df4b97345e480051cbaf9693 (diff)
Fix recording freeze on nvidia when __GL_SYNC_TO_VBLANK is set to 1
-rw-r--r--com.dec05eba.gpu_screen_recorder.appdata.xml7
-rw-r--r--src/main.cpp4
2 files changed, 11 insertions, 0 deletions
diff --git a/com.dec05eba.gpu_screen_recorder.appdata.xml b/com.dec05eba.gpu_screen_recorder.appdata.xml
index 604c823..1aedf4f 100644
--- a/com.dec05eba.gpu_screen_recorder.appdata.xml
+++ b/com.dec05eba.gpu_screen_recorder.appdata.xml
@@ -81,6 +81,13 @@
</screenshots>
<releases>
+ <release version="3.7.7" date="2024-05-30">
+ <description>
+ <ul>
+ <li>Fix recording freeze on nvidia when __GL_SYNC_TO_VBLANK environment variable is set to 1</li>
+ </ul>
+ </description>
+ </release>
<release version="3.7.6" date="2024-05-20">
<description>
<ul>
diff --git a/src/main.cpp b/src/main.cpp
index 16b2a06..e8e35b9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3535,6 +3535,10 @@ int main(int argc, char **argv) {
// nvidia doesn't support vaapi and nvidia-vaapi-driver doesn't support encoding yet.
// Let vaapi find the match vaapi driver instead of forcing a specific one.
unsetenv("LIBVA_DRIVER_NAME");
+ // Some people set this to force all applications to vsync on nvidia, but this makes eglSwapBuffers never return.
+ unsetenv("__GL_SYNC_TO_VBLANK");
+ // Same as above, but for amd/intel
+ unsetenv("vblank_mode");
dpy = XOpenDisplay(NULL);
wayland = !dpy || is_xwayland(dpy);