Skip to content

Commit cc0fbb7

Browse files
committed
BufferedStream: available() provide data from source
1 parent 3ff7aaf commit cc0fbb7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/AudioTools/CoreAudio/AudioStreams.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,12 +583,10 @@ class BufferedStream : public ModifyingStream {
583583
return buffer.peekArray(data, len);
584584
}
585585

586-
/// Returns the available bytes in the buffer: to be avoided
586+
/// Returns the available bytes
587587
int available() override {
588-
if (buffer.isEmpty()) {
589-
refill();
590-
}
591-
return buffer.available();
588+
if (p_in == nullptr) return 0;
589+
return buffer.available() + p_in->available();
592590
}
593591

594592
/// Clears all the data in the buffer

0 commit comments

Comments
 (0)