forego memory sample buffer and only write samples that need writing

Rather than writing the entire sequence audio to disk every change, now we
just write the parts we need to write.
This commit is contained in:
itsmattkc
2019-11-20 10:32:46 +09:00
parent 6693fc75a3
commit 2599c1e8a4
4 changed files with 35 additions and 25 deletions
@@ -28,12 +28,6 @@ void AudioRenderBackend::InvalidateCache(const rational &start_range, const rati
rational start_range_adj = qMax(rational(0), start_range);
rational end_range_adj = qMin(viewer_node()->Length(), end_range);
// Truncate to length if necessary
int max_length_in_bytes = params().time_to_bytes(viewer_node()->Length());
if (pcm_data_.size() > max_length_in_bytes) {
pcm_data_.resize(max_length_in_bytes);
}
// Add the range to the list
cache_queue_.append(TimeRange(start_range_adj, end_range_adj));