Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 32 files). Show all
Unified · Split
| @@ -484,17 +484,17 @@ void ScriptEngine::run() { · 483 unmodified lines | ||
| 484 | 484 | |
| 485 | 485 | // write audio packet to AudioMixer nodes |
| 486 | 486 | NodeList* nodeList = NodeList::getInstance(); |
| 487 | − foreach(const SharedNodePointer& node, nodeList->getNodeHash()) { | |
| 487 | + nodeList->eachNode([this, &nodeList, &audioPacket, &numPreSequenceNumberBytes](const SharedNodePointer& node){ | |
| 488 | 488 | // only send to nodes of type AudioMixer |
| 489 | 489 | if (node->getType() == NodeType::AudioMixer) { |
| 490 | 490 | // pack sequence number |
| 491 | 491 | quint16 sequence = _outgoingScriptAudioSequenceNumbers[node->getUUID()]++; |
| 492 | 492 | memcpy(audioPacket.data() + numPreSequenceNumberBytes, &sequence, sizeof(quint16)); |
| 493 | − | |
| 493 | + | |
| 494 | 494 | // send audio packet |
| 495 | 495 | nodeList->writeDatagram(audioPacket, node); |
| 496 | 496 | } |
| 497 | − } | |
| 497 | + }); | |
| 498 | 498 | } |
| 499 | 499 | } |
| 500 | 500 | |