浏览代码

virtualcam-module: Update filter size immediately when used in OBS

Fixes a crash due to the previous output size being used when scaling
the frame.

(cherry picked from commit 9b1f7d6d21bbc11dd27660069ffb65f3c6dd7699)
Richard Stanway 2 年之前
父节点
当前提交
d58efd64b1
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      plugins/win-dshow/virtualcam-module/virtualcam-filter.cpp

+ 5 - 0
plugins/win-dshow/virtualcam-module/virtualcam-filter.cpp

@@ -270,6 +270,11 @@ void VCamFilter::Frame(uint64_t ts)
 			   the format we present to match */
 			SetVideoFormat(GetVideoFormat(), new_obs_cx, new_obs_cy,
 				       new_obs_interval);
+
+			/* Update the new filter size immediately since we
+			   know it just changed above */
+			new_filter_cx = new_obs_cx;
+			new_filter_cy = new_obs_cy;
 		}
 
 		/* Re-initialize the main scaler to use the new resolution */