Skip to content

Commit

Permalink
RP2040 BaseStream correct read() empty to -1
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Jan 6, 2025
1 parent 6a98cc1 commit bca62a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AudioTools/CoreAudio/BaseStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ class BaseStream : public Stream {

virtual int read() override {
refillReadBuffer();
// if it is empty we need to return an int -1
if (tmp_in.isEmpty()) return -1;
return tmp_in.read();
}

virtual int peek() override {
refillReadBuffer();
// if it is empty we need to return an int -1
if (tmp_in.isEmpty()) return -1;
return tmp_in.peek();
}

Expand Down

0 comments on commit bca62a5

Please sign in to comment.