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.
This commit is contained in:
parent
ddcf2436c1
commit
ec5059cee1
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user