mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-11 08:06:41 +02:00
Force unique stream name, use name as id
This commit is contained in:
parent
d76aac0de7
commit
341466ceb5
7 changed files with 32 additions and 39 deletions
|
@ -294,10 +294,10 @@ void StreamServer::onMessageReceived(StreamSession* connection, const msg::BaseM
|
|||
|
||||
// Assign and update stream
|
||||
PcmStreamPtr stream = streamManager_->getStream(client->config.streamId);
|
||||
if (stream == nullptr)
|
||||
if (!stream)
|
||||
{
|
||||
stream = streamManager_->getDefaultStream();
|
||||
client->config.streamId = stream->getUri().id();
|
||||
client->config.streamId = stream->getId();
|
||||
}
|
||||
Config::instance().save();
|
||||
|
||||
|
@ -384,8 +384,8 @@ void StreamServer::start()
|
|||
//TODO: check uniqueness of the stream
|
||||
for (const auto& streamUri: settings_.pcmStreams)
|
||||
{
|
||||
PcmStream* stream = streamManager_->addStream(streamUri);
|
||||
if (stream != NULL)
|
||||
PcmStreamPtr stream = streamManager_->addStream(streamUri);
|
||||
if (stream)
|
||||
logO << "Stream: " << stream->getUri().toJson() << "\n";
|
||||
}
|
||||
streamManager_->start();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue