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)
|
Resampler(int num_samples)
|
||||||
{
|
{
|
||||||
// Only allow even buffer sizes
|
buffer = NULL;
|
||||||
if (num_samples & 1)
|
resize(num_samples);
|
||||||
num_samples++;
|
|
||||||
this->buffer_size = num_samples;
|
|
||||||
buffer = new int16_t[this->buffer_size];
|
|
||||||
r_step = 1.0;
|
r_step = 1.0;
|
||||||
clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~Resampler()
|
~Resampler()
|
||||||
|
@ -223,6 +219,9 @@ class Resampler
|
||||||
{
|
{
|
||||||
if (buffer)
|
if (buffer)
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
|
// Only allow even buffer sizes
|
||||||
|
if (num_samples & 1)
|
||||||
|
num_samples++;
|
||||||
buffer_size = num_samples;
|
buffer_size = num_samples;
|
||||||
buffer = new int16_t[buffer_size];
|
buffer = new int16_t[buffer_size];
|
||||||
clear();
|
clear();
|
||||||
|
|
Loading…
Reference in New Issue