[WASAPI] fix stream types and frequencies enumeration
[xbmc.git] / xbmc / events / EventLogManager.cpp
blob8fc306c25730cb8af85cf7ce572af4b466eaf518
1 /*
2 * Copyright (C) 2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #include "EventLogManager.h"
11 #include "EventLog.h"
13 #include <memory>
14 #include <mutex>
15 #include <utility>
17 CEventLog& CEventLogManager::GetEventLog(unsigned int profileId)
19 std::unique_lock<CCriticalSection> lock(m_eventMutex);
21 auto eventLog = m_eventLogs.find(profileId);
22 if (eventLog == m_eventLogs.end())
24 m_eventLogs.insert(std::make_pair(profileId, std::make_unique<CEventLog>()));
25 eventLog = m_eventLogs.find(profileId);
28 return *eventLog->second;