mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-30 22:59:51 +02:00
Discard old chunks if not consumed (fixes #708)
This commit is contained in:
parent
8e9eb5c870
commit
136766412c
3 changed files with 30 additions and 5 deletions
|
@ -103,8 +103,16 @@ public:
|
|||
std::lock_guard<std::mutex> mlock(mutex_);
|
||||
if (queue_.empty())
|
||||
return false;
|
||||
T t = queue_.back();
|
||||
copy = t;
|
||||
copy = queue_.back();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool front_copy(T& copy)
|
||||
{
|
||||
std::lock_guard<std::mutex> mlock(mutex_);
|
||||
if (queue_.empty())
|
||||
return false;
|
||||
copy = queue_.front();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue