audiobackend: truncate PCM cache size when the length is reduced

This commit is contained in:
itsmattkc
2020-03-18 19:08:18 +11:00
parent 6ddfd2fc8e
commit 7771bab5a0
3 changed files with 16 additions and 0 deletions
@@ -85,6 +85,7 @@ void AudioBackend::ThreadCompletedCache(NodeDependency dep, NodeValueTable data,
f.write(cached_samples.data(), copy_length);
if (copy_length < length) {
// Fill in remainder with silence
QByteArray empty_space(length - copy_length, 0);
f.write(empty_space);