Cog Audio: Implement virtual ring buffer function to read buffered bytes count
parent
d1b519d59d
commit
52b17bd4d8
|
@ -68,7 +68,8 @@
|
|||
// Checks if the buffer is empty or not. This is safe in any thread.
|
||||
- (BOOL)isEmpty;
|
||||
|
||||
- (UInt32)bufferLength;
|
||||
// Return amount buffered
|
||||
- (UInt32)bufferedLength;
|
||||
|
||||
// Read operations:
|
||||
|
||||
|
|
|
@ -73,9 +73,9 @@ static void deallocateVirtualBuffer(void *buffer, UInt32 bufferLength);
|
|||
}
|
||||
|
||||
|
||||
- (UInt32)bufferLength
|
||||
- (UInt32)bufferedLength
|
||||
{
|
||||
return bufferLength;
|
||||
return atomic_load_explicit(&bufferFilled, memory_order_relaxed);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue