diff --git a/plugins/win-dshow/win-dshow.cpp b/plugins/win-dshow/win-dshow.cpp index 47f02dcab..85a542a8c 100644 --- a/plugins/win-dshow/win-dshow.cpp +++ b/plugins/win-dshow/win-dshow.cpp @@ -1145,12 +1145,22 @@ static const char *GetDShowInputName(void *) return TEXT_INPUT_NAME; } +static void proc_activate(void *data, calldata_t *cd) +{ + bool activate = calldata_bool(cd, "active"); + DShowInput *input = reinterpret_cast(data); + input->SetActive(activate); +} + static void *CreateDShowInput(obs_data_t *settings, obs_source_t *source) { DShowInput *dshow = nullptr; try { dshow = new DShowInput(source, settings); + proc_handler_t *ph = obs_source_get_proc_handler(source); + proc_handler_add(ph, "void activate(bool active)", + proc_activate, dshow); } catch (const char *error) { blog(LOG_ERROR, "Could not create device '%s': %s", obs_source_get_name(source), error);