From 1b5426d786abe9ffe1cc742842a2794bd8d5224b Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 19 Mar 2021 17:09:45 +1100 Subject: [PATCH] audioplaybackcache: improve comments/documentation --- app/render/audioplaybackcache.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/render/audioplaybackcache.cpp b/app/render/audioplaybackcache.cpp index 5dc627166..c037e766d 100644 --- a/app/render/audioplaybackcache.cpp +++ b/app/render/audioplaybackcache.cpp @@ -62,7 +62,7 @@ void AudioPlaybackCache::WritePCM(const TimeRange &range, SampleBufferPtr sample return; } - // Determine if we have enough segments to pull this off + // Ensure if we have enough segments to write this data, creating more if not qint64 length_diff = params_.time_to_bytes(range.out()) - playlist_.GetLength(); while (length_diff > 0) { qint64 seg_sz = qMin(kDefaultSegmentSize, length_diff); @@ -70,9 +70,9 @@ void AudioPlaybackCache::WritePCM(const TimeRange &range, SampleBufferPtr sample length_diff -= seg_sz; } + // Convert to packed data, which is what we store on disk so it can be played back easily QByteArray a; if (samples) { - // Convert to packed data, which is what we store on disk a = samples->toPackedData(); } @@ -159,6 +159,8 @@ void AudioPlaybackCache::ShiftEvent(const rational &from_in_time, const rational return; } + qDebug() << "Shifting" << from_in_time << "to" << to_in_time; + qint64 to = params_.time_to_bytes(to_in_time); qint64 from = params_.time_to_bytes(from_in_time);