mirror of https://github.com/snes9xgit/snes9x.git
Resampler: force even buffer sizes in resize
This commit is contained in:
parent
59c48e35a7
commit
afe8dd9f01
|
@ -65,13 +65,9 @@ class Resampler
|
|||
|
||||
Resampler(int num_samples)
|
||||
{
|
||||
// Only allow even buffer sizes
|
||||
if (num_samples & 1)
|
||||
num_samples++;
|
||||
this->buffer_size = num_samples;
|
||||
buffer = new int16_t[this->buffer_size];
|
||||
buffer = NULL;
|
||||
resize(num_samples);
|
||||
r_step = 1.0;
|
||||
clear();
|
||||
}
|
||||
|
||||
~Resampler()
|
||||
|
@ -223,6 +219,9 @@ class Resampler
|
|||
{
|
||||
if (buffer)
|
||||
delete[] buffer;
|
||||
// Only allow even buffer sizes
|
||||
if (num_samples & 1)
|
||||
num_samples++;
|
||||
buffer_size = num_samples;
|
||||
buffer = new int16_t[buffer_size];
|
||||
clear();
|
||||
|
|
Loading…
Reference in New Issue