|
|
@ -582,6 +582,7 @@ namespace stream |
|
|
|
{ |
|
|
|
{ |
|
|
|
SAMSession session; |
|
|
|
SAMSession session; |
|
|
|
session.localDestination = localDestination; |
|
|
|
session.localDestination = localDestination; |
|
|
|
|
|
|
|
std::unique_lock<std::mutex> l(m_SessionsMutex); |
|
|
|
auto ret = m_Sessions.insert (std::pair<std::string, SAMSession>(id, session)); |
|
|
|
auto ret = m_Sessions.insert (std::pair<std::string, SAMSession>(id, session)); |
|
|
|
if (!ret.second) |
|
|
|
if (!ret.second) |
|
|
|
LogPrint ("Session ", id, " already exists"); |
|
|
|
LogPrint ("Session ", id, " already exists"); |
|
|
@ -592,6 +593,7 @@ namespace stream |
|
|
|
|
|
|
|
|
|
|
|
void SAMBridge::CloseSession (const std::string& id) |
|
|
|
void SAMBridge::CloseSession (const std::string& id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
std::unique_lock<std::mutex> l(m_SessionsMutex); |
|
|
|
auto it = m_Sessions.find (id); |
|
|
|
auto it = m_Sessions.find (id); |
|
|
|
if (it != m_Sessions.end ()) |
|
|
|
if (it != m_Sessions.end ()) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -605,6 +607,7 @@ namespace stream |
|
|
|
|
|
|
|
|
|
|
|
SAMSession * SAMBridge::FindSession (const std::string& id) |
|
|
|
SAMSession * SAMBridge::FindSession (const std::string& id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
std::unique_lock<std::mutex> l(m_SessionsMutex); |
|
|
|
auto it = m_Sessions.find (id); |
|
|
|
auto it = m_Sessions.find (id); |
|
|
|
if (it != m_Sessions.end ()) |
|
|
|
if (it != m_Sessions.end ()) |
|
|
|
return &it->second; |
|
|
|
return &it->second; |
|
|
|