mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-01-21 04:39:05 -05:00
Certain programs can start the virtualcam filter, then they may choose to call `Stop()` on the filter, call `SetFormat()` to change the resolution, then call `Run()` again to start the filter again. The Windows virtual camera filter did not account for this, thus if the resolution was different, it had potential to cause a crash. To fix this, store the last filter resolution, then check the resolution every frame, and if it changes, reset the scaling information. (Author note: This code is unclean. What we need to do with the virtual camera filter is make it only create the thread on `Run()`, then join the thread on `Stop()`. It's currently a bit complicated to make it do that at the moment, so this code is a kind of an annoying stopgap for now.)