mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-11 08:06:41 +02:00
Fix thread races
This commit is contained in:
parent
2efd00d8ef
commit
ee158b521d
4 changed files with 5 additions and 13 deletions
|
@ -295,7 +295,6 @@ json PcmStream::toJson() const
|
|||
{"status", to_string(state_)},
|
||||
};
|
||||
|
||||
j["metadata"] = metadata_.toJson();
|
||||
j["properties"] = properties_.toJson();
|
||||
|
||||
return j;
|
||||
|
@ -308,13 +307,6 @@ void PcmStream::addListener(PcmListener* pcmListener)
|
|||
}
|
||||
|
||||
|
||||
const Metatags& PcmStream::getMetadata() const
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
return metadata_;
|
||||
}
|
||||
|
||||
|
||||
const Properties& PcmStream::getProperties() const
|
||||
{
|
||||
// std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
|
@ -448,7 +440,7 @@ void PcmStream::play(ResultHandler handler)
|
|||
|
||||
void PcmStream::setProperties(const Properties& properties)
|
||||
{
|
||||
// std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
Properties props = properties;
|
||||
// Missing metadata means the data didn't change, so
|
||||
// enrich the new properites with old metadata
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue