Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 9 files). Show all
Unified · Split
| @@ -399,10 +399,10 @@ void EntityScriptServer::nodeKilled(SharedNodePointer killedNode) { · 398 unmodified lines | ||
| 399 | 399 | void EntityScriptServer::negotiateAudioFormat() { |
| 400 | 400 | auto nodeList = DependencyManager::get<NodeList>(); |
| 401 | 401 | auto negotiateFormatPacket = NLPacket::create(PacketType::NegotiateAudioFormat); |
| 402 | − auto codecPlugins = PluginManager::getInstance()->getCodecPlugins(); | |
| 402 | + const auto& codecPlugins = PluginManager::getInstance()->getCodecPlugins(); | |
| 403 | 403 | quint8 numberOfCodecs = (quint8)codecPlugins.size(); |
| 404 | 404 | negotiateFormatPacket->writePrimitive(numberOfCodecs); |
| 405 | − for (auto& plugin : codecPlugins) { | |
| 405 | + for (const auto& plugin : codecPlugins) { | |
| 406 | 406 | auto codecName = plugin->getName(); |
| 407 | 407 | negotiateFormatPacket->writeString(codecName); |
| 408 | 408 | } |
| @@ -433,8 +433,8 @@ void EntityScriptServer::selectAudioFormat(const QString& selectedCodecName) { · 24 unmodified lines | ||
| 433 | 433 | _codec = nullptr; |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | − auto codecPlugins = PluginManager::getInstance()->getCodecPlugins(); | |
| 437 | − for (auto& plugin : codecPlugins) { | |
| 436 | + const auto& codecPlugins = PluginManager::getInstance()->getCodecPlugins(); | |
| 437 | + for (const auto& plugin : codecPlugins) { | |
| 438 | 438 | if (_selectedCodecName == plugin->getName()) { |
| 439 | 439 | _codec = plugin; |
| 440 | 440 | _encoder = plugin->createEncoder(AudioConstants::SAMPLE_RATE, AudioConstants::MONO); |