mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-28 16:36:17 +02:00
recover if no chunks are available
This commit is contained in:
parent
25acbc1717
commit
0f9c86c7c2
2 changed files with 25 additions and 11 deletions
|
@ -82,6 +82,9 @@ void Stream::addChunk(msg::PcmChunk* chunk)
|
|||
|
||||
bool Stream::waitForChunk(size_t ms) const
|
||||
{
|
||||
if (!chunks_.empty())
|
||||
return true;
|
||||
|
||||
std::unique_lock<std::mutex> lck(cvMutex_);
|
||||
cv_.wait_for(lck, std::chrono::milliseconds(ms));
|
||||
return !chunks_.empty();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue