mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-20 12:36:17 +02:00
better server shutdown
This commit is contained in:
parent
679fbaaca0
commit
2275466d09
2 changed files with 7 additions and 8 deletions
|
@ -389,6 +389,13 @@ void StreamServer::start()
|
||||||
|
|
||||||
void StreamServer::stop()
|
void StreamServer::stop()
|
||||||
{
|
{
|
||||||
|
// std::lock_guard<std::mutex> mlock(sessionsMutex_);
|
||||||
|
for (auto session: sessions_)//it = sessions_.begin(); it != sessions_.end(); ++it)
|
||||||
|
{
|
||||||
|
if (session)
|
||||||
|
session->stop();
|
||||||
|
}
|
||||||
|
|
||||||
if (controlServer_)
|
if (controlServer_)
|
||||||
{
|
{
|
||||||
controlServer_->stop();
|
controlServer_->stop();
|
||||||
|
@ -406,12 +413,5 @@ void StreamServer::stop()
|
||||||
streamManager_->stop();
|
streamManager_->stop();
|
||||||
streamManager_ = nullptr;
|
streamManager_ = nullptr;
|
||||||
}
|
}
|
||||||
// std::lock_guard<std::mutex> mlock(sessionsMutex_);
|
|
||||||
for (auto session: sessions_)//it = sessions_.begin(); it != sessions_.end(); ++it)
|
|
||||||
{
|
|
||||||
if (session)
|
|
||||||
session->stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,6 @@ const SampleFormat& PcmStream::getSampleFormat() const
|
||||||
void PcmStream::start()
|
void PcmStream::start()
|
||||||
{
|
{
|
||||||
logD << "PcmStream start: " << sampleFormat_.getFormat() << "\n";
|
logD << "PcmStream start: " << sampleFormat_.getFormat() << "\n";
|
||||||
//TODO: wrong encoder settings leads to: terminate called after throwing an instance of 'std::system_error' what(): Invalid argument
|
|
||||||
encoder_->init(this, sampleFormat_);
|
encoder_->init(this, sampleFormat_);
|
||||||
|
|
||||||
active_ = true;
|
active_ = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue