Skip to content

Commit 597fde9

Browse files
committed
copyAll with return code
1 parent 25398d7 commit 597fde9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/AudioTools/AudioCopy.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,18 @@ class StreamCopyT {
175175
delay_on_no_data = delayMs;
176176
}
177177

178-
/// copies all data
179-
void copyAll(int delayMs=5){
178+
/// copies all data - returns true if we copied anything
179+
bool copyAll(int delayMs=5){
180180
LOGD(LOG_METHOD);
181+
bool result = false;
181182
if (from==nullptr || to == nullptr)
182-
return;
183+
return result;
183184

184185
while(copy()){
186+
result = true;
185187
delay(delayMs);
186188
}
189+
return result;
187190
}
188191

189192
/// Provides the actual mime type, that was determined from the first available data

0 commit comments

Comments
 (0)