mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
CR fixes for new networking in AudioClient
This commit is contained in:
parent
c90c5900ce
commit
60797a26ea
1 changed files with 5 additions and 9 deletions
|
@ -853,11 +853,7 @@ void AudioClient::handleAudioInput() {
|
|||
}
|
||||
}
|
||||
|
||||
// seek to the beginning of the audio packet payload
|
||||
_audioPacket->seek(0);
|
||||
|
||||
// reset the size used in this packet so it will be correct once we are done writing
|
||||
_audioPacket->setSizeUsed(0);
|
||||
// reset the audio packet so we can start writing
|
||||
|
||||
// write sequence number
|
||||
_audioPacket->write(&_outgoingAvatarAudioSequenceNumber, sizeof(quint16));
|
||||
|
@ -913,21 +909,21 @@ void AudioClient::sendMuteEnvironmentPacket() {
|
|||
|
||||
int dataSize = sizeof(glm::vec3) + sizeof(float);
|
||||
|
||||
NodeList::Packet mutePacket = nodeList->makePacket(PacketType::MuteEnvironment, dataSize);
|
||||
auto mutePacket = NLPacket::create(PacketType::MuteEnvironment, dataSize);
|
||||
|
||||
const float MUTE_RADIUS = 50;
|
||||
|
||||
glm::vec3 currentSourcePosition = _positionGetter();
|
||||
|
||||
memcpy(mutePacket.payload().data(), ¤tSourcePosition, sizeof(glm::vec3));
|
||||
memcpy(mutePacket.payload() + sizeof(glm::vec3), &MUTE_RADIUS, sizeof(float));
|
||||
mutePacket->write(¤tSourcePosition, sizeof(currentSourcePosition));
|
||||
mutePacket->write(&MUTE_RADIUS, sizeof(MUTE_RADIUS));
|
||||
|
||||
// grab our audio mixer from the NodeList, if it exists
|
||||
SharedNodePointer audioMixer = nodeList->soloNodeOfType(NodeType::AudioMixer);
|
||||
|
||||
if (audioMixer) {
|
||||
// send off this mute packet
|
||||
nodeList->sendPacket(mutePacket, audioMixer);
|
||||
nodeList->sendPacket(std::move(mutePacket), audioMixer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue