Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -520,21 +520,17 @@ void ScriptEngine::run() { · 519 unmodified lines | |||
| 520 | 520 | ||
| 521 | // write audio packet to AudioMixer nodes | 521 | // write audio packet to AudioMixer nodes |
| 522 | NodeList* nodeList = NodeList::getInstance(); | 522 | NodeList* nodeList = NodeList::getInstance(); |
| 523 | NodeHashSnapshot snapshotHash = nodeList->getNodeHash().snapshot_table(); | 523 | nodeList->eachNode([this, &nodeList, &audioPacket, &numPreSequenceNumberBytes](const SharedNodePointer& node){ |
| 524 | |||
| 525 | for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) { | ||
| 526 | SharedNodePointer node = it->second; | ||
| 527 | |||
| 528 | // only send to nodes of type AudioMixer | 524 | // only send to nodes of type AudioMixer |
| 529 | if (node->getType() == NodeType::AudioMixer) { | 525 | if (node->getType() == NodeType::AudioMixer) { |
| 530 | // pack sequence number | 526 | // pack sequence number |
| 531 | quint16 sequence = _outgoingScriptAudioSequenceNumbers[node->getUUID()]++; | 527 | quint16 sequence = _outgoingScriptAudioSequenceNumbers[node->getUUID()]++; |
| 532 | memcpy(audioPacket.data() + numPreSequenceNumberBytes, &sequence, sizeof(quint16)); | 528 | memcpy(audioPacket.data() + numPreSequenceNumberBytes, &sequence, sizeof(quint16)); |
| 533 | 529 | ||
| 534 | // send audio packet | 530 | // send audio packet |
| 535 | nodeList->writeDatagram(audioPacket, node); | 531 | nodeList->writeDatagram(audioPacket, node); |
| 536 | } | 532 | } |
| 537 | } | 533 | }); |
| 538 | } | 534 | } |
| 539 | } | 535 | } |
| 540 | 536 | ||