diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/egl.c | 10 | ||||
-rw-r--r-- | src/main.cpp | 6 |
2 files changed, 14 insertions, 2 deletions
@@ -455,6 +455,16 @@ bool gsr_egl_load(gsr_egl *self, gsr_window *window, bool is_monitor_capture, bo } gsr_egl_disable_vsync(self); + + if(self->gpu_info.vendor == GSR_GPU_VENDOR_NVIDIA) { + /* This fixes nvenc codecs unable to load on openSUSE tumbleweed because of a cuda error. Don't ask me why */ + const bool inside_flatpak = getenv("FLATPAK_ID") != NULL; + if(inside_flatpak) + system("flatpak-spawn --host -- nvidia-smi -f /dev/null"); + else + system("nvidia-smi -f /dev/null"); + } + return true; fail: diff --git a/src/main.cpp b/src/main.cpp index 10dc5a6..42cf4d2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2539,10 +2539,12 @@ static void capture_image_to_file(const char *filepath, std::string &window_str, bool should_stop_error = false; egl->glClear(0); - while(true) { + while(running) { should_stop_error = false; - if(gsr_capture_should_stop(capture, &should_stop_error)) + if(gsr_capture_should_stop(capture, &should_stop_error)) { + running = 0; break; + } // It can fail, for example when capturing portal and the target is a monitor that hasn't been updated. // Desktop portal wont refresh the image until there is an update. |