mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-12 08:36:43 +02:00
Forward metadata and properties in meta stream
This commit is contained in:
parent
fba20fb7fe
commit
3120a18326
4 changed files with 36 additions and 13 deletions
|
@ -86,18 +86,21 @@ void MetaStream::stop()
|
|||
|
||||
void MetaStream::onMetadataChanged(const PcmStream* pcmStream, const Metatags& metadata)
|
||||
{
|
||||
std::ignore = metadata;
|
||||
LOG(DEBUG, LOG_TAG) << "onMetadataChanged: " << pcmStream->getName() << "\n";
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (pcmStream != active_stream_.get())
|
||||
return;
|
||||
setMetadata(metadata);
|
||||
}
|
||||
|
||||
|
||||
void MetaStream::onPropertiesChanged(const PcmStream* pcmStream, const Properties& properties)
|
||||
{
|
||||
std::ignore = properties;
|
||||
LOG(DEBUG, LOG_TAG) << "onPropertiesChanged: " << pcmStream->getName() << "\n";
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (pcmStream != active_stream_.get())
|
||||
return;
|
||||
setProperties(properties);
|
||||
}
|
||||
|
||||
|
||||
|
@ -117,6 +120,8 @@ void MetaStream::onStateChanged(const PcmStream* pcmStream, ReaderState state)
|
|||
LOG(INFO, LOG_TAG) << "Stream: " << name_ << ", switching active stream: " << (active_stream_ ? active_stream_->getName() : "<null>") << " => "
|
||||
<< stream->getName() << "\n";
|
||||
active_stream_ = stream;
|
||||
setMetadata(active_stream_->getMetadata());
|
||||
setProperties(active_stream_->getProperties());
|
||||
resampler_ = make_unique<Resampler>(active_stream_->getSampleFormat(), sampleFormat_);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue