Fix warning

This commit is contained in:
badaix 2020-11-10 17:59:32 +01:00
parent f07453bd60
commit 7abec2eaf6
2 changed files with 3 additions and 3 deletions

View file

@ -42,7 +42,7 @@ MetaStream::MetaStream(PcmListener* pcmListener, std::vector<std::shared_ptr<Pcm
continue; continue;
bool found = false; bool found = false;
for (const auto stream : streams) for (const auto& stream : streams)
{ {
if (stream->getName() == component) if (stream->getName() == component)
{ {
@ -96,7 +96,7 @@ void MetaStream::onStateChanged(const PcmStream* pcmStream, ReaderState state)
{ {
LOG(DEBUG, LOG_TAG) << "onStateChanged: " << pcmStream->getName() << ", state: " << static_cast<int>(state) << "\n"; LOG(DEBUG, LOG_TAG) << "onStateChanged: " << pcmStream->getName() << ", state: " << static_cast<int>(state) << "\n";
std::lock_guard<std::mutex> lock(mutex_); std::lock_guard<std::mutex> lock(mutex_);
for (const auto stream : streams_) for (const auto& stream : streams_)
{ {
if (stream->getState() == ReaderState::kPlaying) if (stream->getState() == ReaderState::kPlaying)
{ {

View file

@ -153,7 +153,7 @@ const PcmStreamPtr StreamManager::getDefaultStream()
if (streams_.empty()) if (streams_.empty())
return nullptr; return nullptr;
for (const auto stream : streams_) for (const auto& stream : streams_)
{ {
if (stream->getCodec() != "null") if (stream->getCodec() != "null")
return stream; return stream;