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 | 521 | // write audio packet to AudioMixer nodes |
| 522 | 522 | NodeList* nodeList = NodeList::getInstance(); |
| 523 | − NodeHashSnapshot snapshotHash = nodeList->getNodeHash().snapshot_table(); | |
| 524 | − | |
| 525 | − for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) { | |
| 526 | − SharedNodePointer node = it->second; | |
| 527 | − | |
| 523 | + nodeList->eachNode([this, &nodeList, &audioPacket, &numPreSequenceNumberBytes](const SharedNodePointer& node){ | |
| 528 | 524 | // only send to nodes of type AudioMixer |
| 529 | 525 | if (node->getType() == NodeType::AudioMixer) { |
| 530 | 526 | // pack sequence number |
| 531 | 527 | quint16 sequence = _outgoingScriptAudioSequenceNumbers[node->getUUID()]++; |
| 532 | 528 | memcpy(audioPacket.data() + numPreSequenceNumberBytes, &sequence, sizeof(quint16)); |
| 533 | − | |
| 529 | + | |
| 534 | 530 | // send audio packet |
| 535 | 531 | nodeList->writeDatagram(audioPacket, node); |
| 536 | 532 | } |
| 537 | − } | |
| 533 | + }); | |
| 538 | 534 | } |
| 539 | 535 | } |
| 540 | 536 | |