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:
pkv
2025-12-08 01:32:41 +01:00
committed by Ryan Foster
parent 91917f8120
commit d9b5addf72

View File

@@ -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 &&params)
{
// 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;