Skip to content

Commit 966e18c

Browse files
committed
StreamingDecoder: copyAll()
1 parent e8497cd commit 966e18c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/AudioTools/AudioCodecs/AudioCodecsBase.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ class StreamingDecoder : public AudioInfoSource {
196196
/// Process a single read operation - to be called in the loop
197197
virtual bool copy() = 0;
198198

199+
/// Process all data
200+
bool copyAll() {
201+
bool result = false;
202+
while (copy()) {
203+
result = true;
204+
}
205+
return result;
206+
}
207+
199208
protected:
200209
virtual size_t readBytes(uint8_t *data, size_t len) = 0;
201210
Print *p_print = nullptr;

0 commit comments

Comments
 (0)