Fix "last seen" timestamp

This commit is contained in:
badaix 2020-03-11 22:02:35 +01:00
parent 4587637487
commit 90785a87da
4 changed files with 32 additions and 12 deletions

View file

@ -59,8 +59,26 @@ public:
bool waitForChunk(const std::chrono::milliseconds& timeout) const;
private:
/// Request an audio chunk from the front of the stream.
/// @param outputBuffer will be filled with the chunk
/// @param frames the number of requested frames
/// @return the timepoint when this chunk should be audible
chronos::time_point_clk getNextPlayerChunk(void* outputBuffer, uint32_t frames);
/// Request an audio chunk from the front of the stream with a tempo adaption
/// @param outputBuffer will be filled with the chunk
/// @param frames the number of requested frames
/// @param framesCorrection number of frames that should be added or removed.
/// The function will allways return "frames" frames, but will fit "frames + framesCorrection" frames into "frames"
/// so if frames is 100 and framesCorrection is 2, 102 frames will be read from the stream and 2 frames will be removed.
/// This makes us "fast-forward" by 2 frames, or if framesCorrection is -3, 97 frames will be read from the stream and
/// filled with 3 frames (simply by dublication), this makes us effectively slower
/// @return the timepoint when this chunk should be audible
chronos::time_point_clk getNextPlayerChunk(void* outputBuffer, uint32_t frames, int32_t framesCorrection);
/// Request a silent audio chunk
/// @param outputBuffer will be filled with the chunk
/// @param frames the number of requested frames
void getSilentPlayerChunk(void* outputBuffer, uint32_t frames) const;
void updateBuffers(int age);