From ec5059cee1d7f140e942bf7ad45645b23dc31dc3 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 19 Sep 2015 09:42:29 -0700 Subject: [PATCH] win-capture: Always have some capture FPS limit For game capture, if a game is running at for example 800 FPS and limit capture framerate is off, it would try to capture all 800 of those frames, dramatically reducing performance more than what would ever be necessary. When limit capture framerate is off, instead of capturing all frames, capture frames at an interval of twice the OBS FPS, identical to how OBS1 works by default. This should greatly increase performance under that circumstance. --- plugins/win-capture/game-capture.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/win-capture/game-capture.c b/plugins/win-capture/game-capture.c index 76772b816..1b5888b78 100644 --- a/plugins/win-capture/game-capture.c +++ b/plugins/win-capture/game-capture.c @@ -494,9 +494,17 @@ static inline void reset_frame_interval(struct game_capture *gc) struct obs_video_info ovi; uint64_t interval = 0; - if (gc->config.limit_framerate && obs_get_video_info(&ovi)) + if (obs_get_video_info(&ovi)) { interval = ovi.fps_den * 1000000000ULL / ovi.fps_num; + /* Always limit capture framerate to some extent. If a game + * running at 900 FPS is being captured without some sort of + * limited capture interval, it will dramatically reduce + * performance. */ + if (!gc->config.limit_framerate) + interval /= 2; + } + gc->global_hook_info->frame_interval = interval; } -- GitLab