mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:10:25 +02:00
Check we have an AM before sending packet
This commit is contained in:
parent
312780a2f6
commit
5a5a396b62
1 changed files with 5 additions and 2 deletions
|
@ -102,6 +102,10 @@ void AudioIOStats::sendDownstreamAudioStatsPacket() {
|
||||||
_receivedAudioStream->perSecondCallbackForUpdatingStats();
|
_receivedAudioStream->perSecondCallbackForUpdatingStats();
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
SharedNodePointer audioMixer = nodeList->soloNodeOfType(NodeType::AudioMixer);
|
||||||
|
if (!audioMixer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
quint8 appendFlag = 0;
|
quint8 appendFlag = 0;
|
||||||
quint16 numStreamStatsToPack = 1;
|
quint16 numStreamStatsToPack = 1;
|
||||||
|
@ -118,8 +122,7 @@ void AudioIOStats::sendDownstreamAudioStatsPacket() {
|
||||||
|
|
||||||
// pack downstream audio stream stats
|
// pack downstream audio stream stats
|
||||||
statsPacket->writePrimitive(stats);
|
statsPacket->writePrimitive(stats);
|
||||||
|
|
||||||
// send packet
|
// send packet
|
||||||
SharedNodePointer audioMixer = nodeList->soloNodeOfType(NodeType::AudioMixer);
|
|
||||||
nodeList->sendPacket(std::move(statsPacket), *audioMixer);
|
nodeList->sendPacket(std::move(statsPacket), *audioMixer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue