Commit 1de2b19f authored by Stefan Westerfeld's avatar Stefan Westerfeld

WavData: reserve memory if possible before loading samples (performance).

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 18bca2b9
......@@ -57,6 +57,9 @@ WavData::load (AudioInputStream *in_stream)
{
m_samples.clear(); // get rid of old contents
if (in_stream->n_frames() != AudioInputStream::N_FRAMES_UNKNOWN)
m_samples.reserve (in_stream->n_frames() * in_stream->n_channels());
vector<float> m_buffer;
while (true)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment