fix device selection (hopefully)

master
Roxie Linden 2023-12-08 12:09:02 -08:00
parent 1b2b5d2de9
commit e3b719f41e
2 changed files with 16 additions and 2 deletions

View File

@ -300,10 +300,10 @@ void LLWebRTCImpl::setRenderDevice(const std::string &id)
{
mTuningDeviceModule->StartPlayout();
}
renderDeviceCount = mPeerDeviceModule->PlayoutDevices();
if (mPeerDeviceModule)
{
renderDeviceCount = mPeerDeviceModule->PlayoutDevices();
for (int16_t i = 0; i < renderDeviceCount; i++)
{
char name[webrtc::kAdmMaxDeviceNameSize];
@ -317,6 +317,7 @@ void LLWebRTCImpl::setRenderDevice(const std::string &id)
break;
}
}
mPeerDeviceModule->StopPlayout();
mPeerDeviceModule->SetPlayoutDevice(mPlayoutDevice);
mPeerDeviceModule->InitSpeaker();
mPeerDeviceModule->InitPlayout();
@ -379,7 +380,14 @@ void LLWebRTCImpl::setTuningMode(bool enable)
});
for (auto& connection : mPeerConnections)
{
connection->enableSenderTracks(enable ? false : !mMute);
if (enable)
{
connection->enableSenderTracks(false);
}
else
{
connection->resetMute();
}
connection->enableReceiverTracks(!enable);
}
}
@ -620,6 +628,11 @@ void LLWebRTCPeerConnectionImpl::setMute(bool mute)
}
}
void LLWebRTCPeerConnectionImpl::resetMute()
{
setMute(mMute);
}
void LLWebRTCPeerConnectionImpl::setReceiveVolume(float volume)
{
mWebRTCImpl->PostSignalingTask(

View File

@ -273,6 +273,7 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnection,
void OnMessage(const webrtc::DataBuffer& buffer) override;
// Helpers
void resetMute();
void enableSenderTracks(bool enable);
void enableReceiverTracks(bool enable);