History

move script-engine library to intel tbb concurrent map

Stephen Birarda committed 12 years ago

Commit 38f2b2a1 parent 51bc5d11 file · +3 −7Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+3−7
@@ -520,21 +520,17 @@ void ScriptEngine::run() { · 519 unmodified lines
520 520
521 // write audio packet to AudioMixer nodes521 // 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 AudioMixer524 // only send to nodes of type AudioMixer
529 if (node->getType() == NodeType::AudioMixer) {525 if (node->getType() == NodeType::AudioMixer) {
530 // pack sequence number526 // 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 packet530 // send audio packet
535 nodeList->writeDatagram(audioPacket, node);531 nodeList->writeDatagram(audioPacket, node);
536 }532 }
537 }533 });
538 }534 }
539 }535 }
540 536