Skip to content

Commit c06b3ba

Browse files
committed
MeasuringStream
1 parent 47854d9 commit c06b3ba

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/AudioTools/CoreAudio/AudioStreams.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -792,10 +792,15 @@ class MeasuringStream : public ModifyingStream {
792792
return estimatedTotalTimeFor(totalBytes) -timeSinceBegin();
793793
}
794794

795-
/// Alternative update method: e.g report actual file positon
796-
void setProcessedBytes(uint32_t pos) {
797-
if (pos < total_bytes_since_begin) begin();
795+
/// Alternative update method: e.g report actual file positon: returns true if the file position was increased
796+
bool setProcessedBytes(uint32_t pos) {
797+
bool is_regular_update = true;
798+
if (pos < total_bytes_since_begin) {
799+
begin();
800+
is_regular_update = false;
801+
}
798802
total_bytes_since_begin = pos;
803+
return is_regular_update;
799804
}
800805

801806
protected:

0 commit comments

Comments
 (0)