浏览代码

libobs-opengl: Disable vsync during present

Brings X11 EGL in line with Wayland. This prevents you from recording at
a higher fps than the monitor where an OBS preview is being displayed.
Kurt Kartaltepe 3 年之前
父节点
当前提交
855572ed7c
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      libobs-opengl/gl-x11-egl.c

+ 3 - 0
libobs-opengl/gl-x11-egl.c

@@ -628,6 +628,9 @@ static void gl_x11_egl_device_present(gs_device_t *device)
 		free(xcb_event);
 		free(xcb_event);
 	}
 	}
 
 
+	if (eglSwapInterval(device->plat->edisplay, 0) == EGL_FALSE) {
+		blog(LOG_ERROR, "eglSwapInterval failed");
+	}
 	if (!eglSwapBuffers(device->plat->edisplay,
 	if (!eglSwapBuffers(device->plat->edisplay,
 			    device->cur_swap->wi->surface))
 			    device->cur_swap->wi->surface))
 		blog(LOG_ERROR, "Cannot swap EGL buffers: %s",
 		blog(LOG_ERROR, "Cannot swap EGL buffers: %s",