From c30d4f50750a8d497f3bb0531efb5b40f692b635 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 16 Jan 2017 04:19:16 -0800 Subject: [PATCH] win-capture: Fix game capture size bug when rehooking When rehooking, even if scaling is off, it'll unintentionally overwrite the game's backbuffer texture size with the scale size. --- plugins/win-capture/game-capture.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/win-capture/game-capture.c b/plugins/win-capture/game-capture.c index d2269ebd8..95caa8ecf 100644 --- a/plugins/win-capture/game-capture.c +++ b/plugins/win-capture/game-capture.c @@ -728,8 +728,10 @@ static inline bool init_hook_info(struct game_capture *gc) gc->global_hook_info->capture_overlay = gc->config.capture_overlays; gc->global_hook_info->force_shmem = gc->config.force_shmem; gc->global_hook_info->use_scale = gc->config.force_scaling; - gc->global_hook_info->cx = gc->config.scale_cx; - gc->global_hook_info->cy = gc->config.scale_cy; + if (gc->config.scale_cx) + gc->global_hook_info->cx = gc->config.scale_cx; + if (gc->config.scale_cy) + gc->global_hook_info->cy = gc->config.scale_cy; reset_frame_interval(gc); obs_enter_graphics();