We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f6ac2c commit e8a6f56Copy full SHA for e8a6f56
src/Experiments/TimeInfoStream.h
@@ -69,9 +69,17 @@ class TimeInfoStream : public AudioStreamX {
69
70
/// Provides only data for the indicated start and end time
71
size_t readBytes(uint8_t *buffer, size_t length) override {
72
+ // if reading is not supported we stop
73
if (p_stream==nullptr) return 0;
- size_t result = p_stream->readBytes(buffer, length);
74
- calculateTime(result);
+ // if we are past the end we stop
75
+ if (!isActive()) return 0;
76
+ // read the data now
77
+ size_t result=0;
78
+ do {
79
+ result = p_stream->readBytes(buffer, length);
80
+ calculateTime(result);
81
+ // ignore data before start time
82
+ } while(result>0 && current_time<start_time);
83
return isPlaying()?result : 0;
84
}
85
0 commit comments