don't manage display name or send empty to downstream

This commit is contained in:
Stephen Birarda 2017-06-14 17:17:32 -07:00
parent 224a559602
commit 747cca9beb
2 changed files with 17 additions and 14 deletions

View file

@ -225,7 +225,9 @@ void AvatarMixer::start() {
auto start = usecTimestampNow(); auto start = usecTimestampNow();
nodeList->nestedEach([&](NodeList::const_iterator cbegin, NodeList::const_iterator cend) { nodeList->nestedEach([&](NodeList::const_iterator cbegin, NodeList::const_iterator cend) {
std::for_each(cbegin, cend, [&](const SharedNodePointer& node) { std::for_each(cbegin, cend, [&](const SharedNodePointer& node) {
manageDisplayName(node); if (node->getType() == NodeType::Agent && !node->isUpstream()) {
manageDisplayName(node);
}
++_sumListeners; ++_sumListeners;
}); });
}, &lockWait, &nodeTransform, &functor); }, &lockWait, &nodeTransform, &functor);

View file

@ -441,7 +441,6 @@ void AvatarMixerSlave::broadcastAvatarDataToDownstreamMixer(const SharedNodePoin
AvatarMixerClientData* nodeData = reinterpret_cast<AvatarMixerClientData*>(node->getLinkedData()); AvatarMixerClientData* nodeData = reinterpret_cast<AvatarMixerClientData*>(node->getLinkedData());
if (!nodeData) { if (!nodeData) {
qDebug() << "No node data";
return; return;
} }
@ -544,22 +543,24 @@ void AvatarMixerSlave::broadcastAvatarDataToDownstreamMixer(const SharedNodePoin
} }
}); });
quint64 startPacketSending = usecTimestampNow(); if (avatarPacketList->getNumPackets() > 0) {
quint64 startPacketSending = usecTimestampNow();
// close the current packet so that we're always sending something // close the current packet so that we're always sending something
avatarPacketList->closeCurrentPacket(true); avatarPacketList->closeCurrentPacket(true);
_stats.numPacketsSent += (int)avatarPacketList->getNumPackets(); _stats.numPacketsSent += (int)avatarPacketList->getNumPackets();
_stats.numBytesSent += numAvatarDataBytes; _stats.numBytesSent += numAvatarDataBytes;
// send the replicated bulk avatar data // send the replicated bulk avatar data
auto nodeList = DependencyManager::get<NodeList>(); auto nodeList = DependencyManager::get<NodeList>();
nodeList->sendPacketList(std::move(avatarPacketList), node->getPublicSocket()); nodeList->sendPacketList(std::move(avatarPacketList), node->getPublicSocket());
// record the bytes sent for other avatar data in the AvatarMixerClientData // record the bytes sent for other avatar data in the AvatarMixerClientData
nodeData->recordSentAvatarData(numAvatarDataBytes); nodeData->recordSentAvatarData(numAvatarDataBytes);
quint64 endPacketSending = usecTimestampNow(); quint64 endPacketSending = usecTimestampNow();
_stats.packetSendingElapsedTime += (endPacketSending - startPacketSending); _stats.packetSendingElapsedTime += (endPacketSending - startPacketSending);
}
} }