소스 검색

linux-pipewire: Load glad symbols on start

After the cmake 3.0 rebuild glad was transitioned to a static library.
This lead to the glad symbols being uninitialized and crashes when they
are used in some cases.

(cherry picked from commit 5cf0f06669189196f2c1b28c9ccbd56034538f3d)
Kurt Kartaltepe 2 년 전
부모
커밋
9f79146a12
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      plugins/linux-pipewire/linux-pipewire.c

+ 5 - 0
plugins/linux-pipewire/linux-pipewire.c

@@ -21,6 +21,7 @@
 
 #include <obs-module.h>
 #include <obs-nix-platform.h>
+#include <glad/glad.h>
 
 #include <pipewire/pipewire.h>
 #include "screencast-portal.h"
@@ -34,6 +35,10 @@ MODULE_EXPORT const char *obs_module_description(void)
 
 bool obs_module_load(void)
 {
+	obs_enter_graphics();
+	gladLoadGL();
+	obs_leave_graphics();
+
 	pw_init(NULL, NULL);
 
 	screencast_portal_load();