diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-02-11 15:33:55 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-02-11 15:33:55 +0100 |
commit | 985d96bf89b5d46a7bc7885578000a4f5ebc56d8 (patch) | |
tree | 962e0e163b5d36dc453672ba604fa1c39be6164d /src/main.cpp | |
parent | 164145db29e76725a6b0a6ef1d0b0e5bc88fdd70 (diff) |
Fix nvfbc capture crash on start
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index f4c15b4..9dff159 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1380,7 +1380,8 @@ static void list_supported_video_codecs() { _exit(2); gsr_egl_unload(&egl); - XCloseDisplay(dpy); + if(dpy) + XCloseDisplay(dpy); char card_path[128]; card_path[0] = '\0'; @@ -1494,16 +1495,15 @@ static gsr_capture* create_capture_impl(const char *window_str, const char *scre capture_target = "screen"; } - gsr_egl_unload(&egl); - gsr_capture_nvfbc_params nvfbc_params; - nvfbc_params.egl->x11.dpy = egl.x11.dpy; + nvfbc_params.dpy = egl.x11.dpy; nvfbc_params.display_to_capture = capture_target; nvfbc_params.fps = fps; nvfbc_params.pos = { 0, 0 }; nvfbc_params.size = { 0, 0 }; nvfbc_params.direct_capture = direct_capture; nvfbc_params.overclock = overclock; + gsr_egl_unload(&egl); capture = gsr_capture_nvfbc_create(&nvfbc_params); if(!capture) _exit(1); |