aboutsummaryrefslogtreecommitdiff
path: root/src/capture/nvfbc.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-12-23 12:40:16 +0100
committerdec05eba <dec05eba@protonmail.com>2023-12-23 12:40:16 +0100
commit84f9a042729ca76b3b56e824fede202cc6d2897b (patch)
treeb337d1f6b6edbfc017b72b82596856a3b8d32375 /src/capture/nvfbc.c
parent02ee8b8d0f80b759f13601523c4514fb23bf5fce (diff)
Small changes who cares
Diffstat (limited to 'src/capture/nvfbc.c')
-rw-r--r--src/capture/nvfbc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/capture/nvfbc.c b/src/capture/nvfbc.c
index 5b62310..e6ee1a9 100644
--- a/src/capture/nvfbc.c
+++ b/src/capture/nvfbc.c
@@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <math.h>
#include <X11/Xlib.h>
#include <libavutil/hwcontext.h>
#include <libavutil/hwcontext_cuda.h>
@@ -297,7 +298,7 @@ static int gsr_capture_nvfbc_start(gsr_capture *cap, AVCodecContext *video_codec
if(capture_region)
create_capture_params.captureBox = (NVFBC_BOX){ x, y, width, height };
create_capture_params.eTrackingType = tracking_type;
- create_capture_params.dwSamplingRateMs = 1000u / ((uint32_t)cap_nvfbc->params.fps + 1);
+ create_capture_params.dwSamplingRateMs = (uint32_t)ceilf(1000.0f / (float)cap_nvfbc->params.fps);
create_capture_params.bAllowDirectCapture = direct_capture ? NVFBC_TRUE : NVFBC_FALSE;
create_capture_params.bPushModel = direct_capture ? NVFBC_TRUE : NVFBC_FALSE;
//create_capture_params.bDisableAutoModesetRecovery = true; // TODO: