13
0

zita-resampler: pass-through data if not configured

This is in preparation to allow fixed-speed processing without
resampler latency
This commit is contained in:
Robin Gareus 2022-05-23 15:39:17 +02:00
parent f02e8d34e3
commit bb4a45ebaf
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -169,7 +169,13 @@ VMResampler::process (void)
double ph, dp; double ph, dp;
float a, *p1, *p2; float a, *p1, *p2;
if (!_table) return 1; if (!_table) {
n = std::min (inp_count, out_count);
memcpy (out_data, inp_data, n * sizeof (float));
out_count -= n;
inp_count -= n;
return 1;
}
const int hl = _table->_hl; const int hl = _table->_hl;
const unsigned int np = _table->_np; const unsigned int np = _table->_np;
@ -208,6 +214,7 @@ VMResampler::process (void)
out_count -= to_proc; out_count -= to_proc;
in += to_proc; in += to_proc;
if (in >= _inmax) { if (in >= _inmax) {
// assert (_inmax == in)
memcpy (_buff, _buff + in, (2 * hl - 1) * sizeof (float)); memcpy (_buff, _buff + in, (2 * hl - 1) * sizeof (float));
in = 0; in = 0;
} }