Unregister requested data channel when using the negotiated one.
When creating a new connection, the viewer builds a data channel interface. It then gets a new one, which is a proxy. The viewer uses the new one, and therefore must unregister the callbacks from the old one. Also, update the position data before sending it after the join is sent.master
parent
f9cb9a2b05
commit
07c3095a78
|
|
@ -957,6 +957,10 @@ void LLWebRTCPeerConnectionImpl::OnRemoveTrack(rtc::scoped_refptr<webrtc::RtpRec
|
|||
|
||||
void LLWebRTCPeerConnectionImpl::OnDataChannel(rtc::scoped_refptr<webrtc::DataChannelInterface> channel)
|
||||
{
|
||||
if (mDataChannel)
|
||||
{
|
||||
mDataChannel->UnregisterObserver();
|
||||
}
|
||||
mDataChannel = channel;
|
||||
channel->RegisterObserver(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2688,7 +2688,11 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
|
|||
{
|
||||
sendJoin(); // tell the Secondlife WebRTC server that we're here via the data channel.
|
||||
setVoiceConnectionState(VOICE_STATE_SESSION_UP);
|
||||
LLWebRTCVoiceClient::getInstance()->sendPositionUpdate(true);
|
||||
if (isSpatial())
|
||||
{
|
||||
LLWebRTCVoiceClient::getInstance()->updatePosition();
|
||||
LLWebRTCVoiceClient::getInstance()->sendPositionUpdate(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,7 +201,8 @@ public:
|
|||
void OnConnectionFailure(const std::string &channelID,
|
||||
const LLUUID ®ionID,
|
||||
LLVoiceClientStatusObserver::EStatusType status_type = LLVoiceClientStatusObserver::ERROR_UNKNOWN);
|
||||
void sendPositionUpdate(bool force);
|
||||
void updatePosition(void); // update the internal position state
|
||||
void sendPositionUpdate(bool force); // send the position to the voice server.
|
||||
void updateOwnVolume();
|
||||
|
||||
//////////////////////////////
|
||||
|
|
@ -398,7 +399,6 @@ public:
|
|||
|
||||
/////////////////////////////
|
||||
// Sending updates of current state
|
||||
void updatePosition(void);
|
||||
void setListenerPosition(const LLVector3d &position, const LLVector3 &velocity, const LLQuaternion &rot);
|
||||
void setAvatarPosition(const LLVector3d &position, const LLVector3 &velocity, const LLQuaternion &rot);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue