mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-07 19:57:43 +02:00
fixed deadlock in server shutdown
This commit is contained in:
parent
341466ceb5
commit
935899b0a2
5 changed files with 35 additions and 23 deletions
|
@ -130,7 +130,8 @@ void PcmStream::setState(const ReaderState& newState)
|
|||
if (newState != state_)
|
||||
{
|
||||
state_ = newState;
|
||||
pcmListener_->onStateChanged(this, newState);
|
||||
if (pcmListener_)
|
||||
pcmListener_->onStateChanged(this, newState);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +145,8 @@ void PcmStream::onChunkEncoded(const Encoder* encoder, msg::PcmChunk* chunk, dou
|
|||
chunk->timestamp.sec = tvEncodedChunk_.tv_sec;
|
||||
chunk->timestamp.usec = tvEncodedChunk_.tv_usec;
|
||||
chronos::addUs(tvEncodedChunk_, duration * 1000);
|
||||
pcmListener_->onChunkRead(this, chunk, duration);
|
||||
if (pcmListener_)
|
||||
pcmListener_->onChunkRead(this, chunk, duration);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue