Skip to content

Commit aeb04f8

Browse files
committed
Fix issue where mac was crashing during an attempt to unplug or replug microphone.
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.
1 parent 4e2a966 commit aeb04f8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

indra/llwebrtc/llwebrtc.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,14 +572,20 @@ void LLWebRTCImpl::workerDeployDevices()
572572
void LLWebRTCImpl::setCaptureDevice(const std::string &id)
573573
{
574574

575-
mRecordingDevice = id;
576-
deployDevices();
575+
if (mRecordingDevice != id)
576+
{
577+
mRecordingDevice = id;
578+
deployDevices();
579+
}
577580
}
578581

579582
void LLWebRTCImpl::setRenderDevice(const std::string &id)
580583
{
581-
mPlayoutDevice = id;
582-
deployDevices();
584+
if (mPlayoutDevice != id)
585+
{
586+
mPlayoutDevice = id;
587+
deployDevices();
588+
}
583589
}
584590

585591
// updateDevices needs to happen on the worker thread.

0 commit comments

Comments
 (0)