Default output devices changes may call OnDefaultDeviceChanged multiple times during a single real device change event. Ignoring changes that don't match eRender or the notification client's configured role reduces this somewhat, but it seem useful to debounce device changes even when they do match the flow and role of the stream if they arrive closely together and the new device_id is the same as the previously seen one. Chromium does something similar, so I've taken inspiration from that code and used the same debounce timer (250ms).
Default output devices changes may call
OnDefaultDeviceChanged
multiple times during a single real device change event. Ignoring changes that don't matcheRender
or the notification client's configured role reduces this somewhat, but it seem useful to debounce device changes even when they do match the flow and role of the stream if they arrive closely together and the newdevice_id
is the same as the previously seen one. Chromium does something similar, so I've taken inspiration from that code and used the same debounce timer (250ms).