From c0aec7d8f4bf0fd841351d8e3517406cf256c88b Mon Sep 17 00:00:00 2001 From: arcnmx Date: Sun, 25 Jul 2021 22:14:10 -0700 Subject: [PATCH] [host] nvfbc: disable pointerThread when unused fixes log spam that would occur when decoupleCursor=false --- host/platform/Windows/capture/NVFBC/src/nvfbc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/host/platform/Windows/capture/NVFBC/src/nvfbc.c b/host/platform/Windows/capture/NVFBC/src/nvfbc.c index 02458524..8e01dbef 100644 --- a/host/platform/Windows/capture/NVFBC/src/nvfbc.c +++ b/host/platform/Windows/capture/NVFBC/src/nvfbc.c @@ -239,7 +239,7 @@ static bool nvfbc_init(void) Sleep(100); - if (!lgCreateThread("NvFBCPointer", pointerThread, NULL, &this->pointerThread)) + if (this->seperateCursor && !lgCreateThread("NvFBCPointer", pointerThread, NULL, &this->pointerThread)) { DEBUG_ERROR("Failed to create the NvFBCPointer thread"); nvfbc_deinit(); @@ -254,12 +254,15 @@ static void nvfbc_stop(void) { this->stop = true; - lgSignalEvent(this->cursorEvent); - - if (this->pointerThread) + if (this->seperateCursor) { - lgJoinThread(this->pointerThread, NULL); - this->pointerThread = NULL; + lgSignalEvent(this->cursorEvent); + + if (this->pointerThread) + { + lgJoinThread(this->pointerThread, NULL); + this->pointerThread = NULL; + } } }