Fix issue where mac was crashing during an attempt to unplug or replug microphone. (#4897)

The mac audio device manager was being "helpful" by restarting
playout and recording if the Default device was changed, assuming
the application wouldn't care.
However, we received an update of device change, and attempted to
stop and start playout anyway, causing a conflict.
The fix was simply to not deploy new devices when the device id didn't
change.
master
Roxanne Skelly 2025-10-28 10:03:25 -07:00 committed by GitHub
parent 4e2a9667bd
commit 164912418c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 4 deletions

View File

@ -572,14 +572,20 @@ void LLWebRTCImpl::workerDeployDevices()
void LLWebRTCImpl::setCaptureDevice(const std::string &id)
{
mRecordingDevice = id;
deployDevices();
if (mRecordingDevice != id)
{
mRecordingDevice = id;
deployDevices();
}
}
void LLWebRTCImpl::setRenderDevice(const std::string &id)
{
mPlayoutDevice = id;
deployDevices();
if (mPlayoutDevice != id)
{
mPlayoutDevice = id;
deployDevices();
}
}
// updateDevices needs to happen on the worker thread.