player/Thread: stop buffering if buffer is full
Shouldn't ever happen, but who knows...
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
*/
|
||||
class MusicBuffer {
|
||||
/** a mutex which protects #buffer */
|
||||
Mutex mutex;
|
||||
mutable Mutex mutex;
|
||||
|
||||
SliceBuffer<MusicChunk> buffer;
|
||||
|
||||
@@ -53,6 +53,11 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
bool IsFull() const noexcept {
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
return buffer.IsFull();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total number of reserved chunks in this buffer. This
|
||||
* is the same value which was passed to the constructor
|
||||
|
||||
Reference in New Issue
Block a user