summaryrefslogtreecommitdiff
path: root/indra/llwebrtc/llwebrtc.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2025-12-12 11:57:07 -0800
committerGitHub <noreply@github.com>2025-12-12 11:57:07 -0800
commit24bb1e58f87bbc42ec006d1eb107091c709b6de3 (patch)
tree99031882ec6fd39473d8b67f5cb06f8d38d8be2f /indra/llwebrtc/llwebrtc.cpp
parent43341b7aa9c883066c6d31da929cc30732da66f9 (diff)
parentf4eec813a3043e2277ae62da6a829c65887d0785 (diff)
Merge branch 'develop' into rider/privileged_land
Diffstat (limited to 'indra/llwebrtc/llwebrtc.cpp')
-rw-r--r--indra/llwebrtc/llwebrtc.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp
index 76ca4abb25..8e08239ee6 100644
--- a/indra/llwebrtc/llwebrtc.cpp
+++ b/indra/llwebrtc/llwebrtc.cpp
@@ -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.
@@ -808,6 +814,7 @@ LLWebRTCPeerConnectionImpl::~LLWebRTCPeerConnectionImpl()
{
mSignalingObserverList.clear();
mDataObserverList.clear();
+ mPeerConnectionFactory.release();
if (mPendingJobs > 0)
{
RTC_LOG(LS_ERROR) << __FUNCTION__ << "Destroying a connection that has " << std::to_string(mPendingJobs) << " unfinished jobs that might cause workers to crash";
@@ -871,7 +878,6 @@ void LLWebRTCPeerConnectionImpl::terminate()
}
mPendingJobs--;
});
- mPeerConnectionFactory.release();
}
void LLWebRTCPeerConnectionImpl::setSignalingObserver(LLWebRTCSignalingObserver *observer) { mSignalingObserverList.emplace_back(observer); }
@@ -998,6 +1004,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti
}
webrtc::PeerConnectionInterface::RTCOfferAnswerOptions offerOptions;
+ this->AddRef(); // CreateOffer will deref this when it's done. Without this, the callbacks never get called.
mPeerConnection->CreateOffer(this, offerOptions);
mPendingJobs--;
});