Skip to content
Snippets Groups Projects
Commit 62a74ed7 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

audiobuffer: cleanup, make zero-padding explicit

Rationale: it's more obvious that trailing zeroes are being added
here than if no parameter is given.

Refs #49181

Change-Id: Ie7843328e248ac0e195da9c2d62f6b8a9467deaf
parent 8c5a8be8
No related branches found
No related tags found
No related merge requests found
...@@ -129,8 +129,9 @@ void AudioBuffer::resize(size_t sample_num) ...@@ -129,8 +129,9 @@ void AudioBuffer::resize(size_t sample_num)
if (frames() == sample_num) if (frames() == sample_num)
return; return;
for (unsigned i = 0; i < samples_.size(); i++) // will add zero padding if buffer is growing
samples_[i].resize(sample_num); for (auto &s : samples_)
s.resize(sample_num, 0);
} }
std::vector<SFLAudioSample> * AudioBuffer::getChannel(unsigned chan /* = 0 */) std::vector<SFLAudioSample> * AudioBuffer::getChannel(unsigned chan /* = 0 */)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment