Skip to content

Commit eb294a8

Browse files
committed
StreamCopy set default check_available_for_write to false
1 parent 864ff16 commit eb294a8

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

examples/examples-webserver/streams-generator-webserverex_wav/streams-generator-webserverex_wav.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ void setup() {
2828
AudioLogger::instance().begin(Serial,AudioLogger::Info);
2929
HttpLogger.setLevel(tinyhttp::Info);
3030

31+
// activate additional checks
32+
copier.setCheckAvailableForWrite(true);
33+
3134
// start server
3235
auto cfg = server.defaultConfig();
3336
cfg.sample_rate = sample_rate;

src/AudioLibs/AudioServerEx.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ class AudioWAVServerEx : public AudioServerEx {
156156
}
157157

158158
protected:
159+
// Dynamic memory
160+
tinyhttp::StrExt header;
161+
159162
// wav files start with a 44 bytes header
160163
virtual tinyhttp::Str* getReplyHeader() {
161164
header.allocate(44);
@@ -174,10 +177,6 @@ class AudioWAVServerEx : public AudioServerEx {
174177

175178
return &header;
176179
}
177-
178-
// Dynamic memory
179-
tinyhttp::StrExt header;
180-
181180
};
182181

183182
}

src/AudioTools/AudioCopy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class StreamCopyT {
258258
int (*availableCallback)(Stream*stream)=nullptr;
259259
void *onWriteObj = nullptr;
260260
bool is_first = false;
261-
bool check_available_for_write = true;
261+
bool check_available_for_write = false;
262262
const char* actual_mime = nullptr;
263263
int retryLimit = COPY_RETRY_LIMIT;
264264
int delay_on_no_data = COPY_DELAY_ON_NODATA;

0 commit comments

Comments
 (0)