mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-04-04 23:04:20 -04:00
win-wasapi: Add monitoring deduplication calls
For 'wasapi output capture', calls are added when devices are either changed, started or removed. The calls trigger checks against the monitoring device. Signed-off-by: pkv <pkv@obsproject.com>
This commit is contained in:
@@ -464,6 +464,9 @@ WASAPISource::~WASAPISource()
|
||||
if (notify) {
|
||||
notify->RemoveDefaultDeviceChangedCallback(this);
|
||||
}
|
||||
// If the device is also used for monitoring, a cleanup is needed.
|
||||
if (sourceType == SourceType::DeviceOutput)
|
||||
obs_source_audio_output_capture_device_changed(source, NULL);
|
||||
|
||||
Stop();
|
||||
}
|
||||
@@ -503,6 +506,10 @@ WASAPISource::UpdateParams WASAPISource::BuildUpdateParams(obs_data_t *settings)
|
||||
|
||||
void WASAPISource::UpdateSettings(UpdateParams &¶ms)
|
||||
{
|
||||
// Signal to deduplication logic in case the device is also used for monitoring.
|
||||
if (device_id != params.device_id && sourceType == SourceType::DeviceOutput)
|
||||
obs_source_audio_output_capture_device_changed(source, params.device_id.c_str());
|
||||
|
||||
device_id = std::move(params.device_id);
|
||||
useDeviceTiming = params.useDeviceTiming;
|
||||
isDefaultDevice = params.isDefaultDevice;
|
||||
|
||||
Reference in New Issue
Block a user