Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d7a2baf authored by Jakub Pawłowski's avatar Jakub Pawłowski Committed by Gerrit Code Review
Browse files

Merge "leaudio: Fix getting first device."

parents 26217c47 779b8f87
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -116,10 +116,12 @@ void LeAudioDeviceGroup::Activate(void) {
}

LeAudioDevice* LeAudioDeviceGroup::GetFirstDevice(void) {
  auto d = leAudioDevices_.front();
  if (d.expired()) return nullptr;
  auto iter = std::find_if(leAudioDevices_.begin(), leAudioDevices_.end(),
                           [](auto& iter) { return !iter.expired(); });

  if (iter == leAudioDevices_.end()) return nullptr;

  return (d.lock()).get();
  return (iter->lock()).get();
}

LeAudioDevice* LeAudioDeviceGroup::GetFirstDeviceWithActiveContext(