mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-11 16:16:42 +02:00
Process messages asynchronously
This commit is contained in:
parent
5e2d14d39a
commit
0eaee48f10
10 changed files with 106 additions and 89 deletions
|
@ -54,14 +54,14 @@ void StreamServer::cleanup()
|
|||
}
|
||||
|
||||
|
||||
void StreamServer::addSession(const std::shared_ptr<StreamSession>& session)
|
||||
void StreamServer::addSession(std::shared_ptr<StreamSession> session)
|
||||
{
|
||||
session->setMessageReceiver(this);
|
||||
session->setBufferMs(settings_.stream.bufferMs);
|
||||
session->start();
|
||||
|
||||
std::lock_guard<std::recursive_mutex> mlock(sessionsMutex_);
|
||||
sessions_.emplace_back(session);
|
||||
sessions_.emplace_back(std::move(session));
|
||||
cleanup();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue