Commit 8d904fe3 authored by sletz's avatar sletz
Browse files

Apply srcfactor.diff patch for ticket #162.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3962 0c269be4-1314-0410-8aa9-9f06e86f4224
parent c8115964
......@@ -32,7 +32,8 @@ Arnold Krille
2010-03-19 Stephane Letz <letz@grame.fr>
* Fix some file header to have library side code use LGPL.
* Fix some file header to have library side code use LGPL.
* Apply srcfactor.diff patch for ticket #162.
2010-03-06 Stephane Letz <letz@grame.fr>
......
......@@ -38,6 +38,8 @@ int jack_buffer_size;
int quit = 0;
double resample_mean = 1.0;
double static_resample_factor = 1.0;
double resample_lower_limit = 0.25;
double resample_upper_limit = 4.0;
double *offset_array;
double *window_array;
......@@ -388,8 +390,8 @@ int process (jack_nframes_t nframes, void *arg) {
output_offset = (float) offset;
// Clamp a bit.
if( current_resample_factor < 0.25 ) current_resample_factor = 0.25;
if( current_resample_factor > 4 ) current_resample_factor = 4;
if( current_resample_factor < resample_lower_limit ) current_resample_factor = resample_lower_limit;
if( current_resample_factor > resample_upper_limit ) current_resample_factor = resample_upper_limit;
// Now Calculate how many samples we need.
rlen = ceil( ((double)nframes) / current_resample_factor )+2;
......@@ -675,6 +677,8 @@ int main (int argc, char *argv[]) {
printf( "selected sample format: %s\n", formats[format].name );
static_resample_factor = (double) jack_sample_rate / (double) sample_rate;
resample_lower_limit = static_resample_factor * 0.25;
resample_upper_limit = static_resample_factor * 4.0;
resample_mean = static_resample_factor;
offset_array = malloc( sizeof(double) * smooth_size );
......
......@@ -37,6 +37,8 @@ int jack_buffer_size;
double resample_mean = 1.0;
double static_resample_factor = 1.0;
double resample_lower_limit = 0.25;
double resample_upper_limit = 4.0;
double *offset_array;
double *window_array;
......@@ -395,8 +397,8 @@ int process (jack_nframes_t nframes, void *arg) {
output_offset = (float) offset;
// Clamp a bit.
if( current_resample_factor < 0.25 ) current_resample_factor = 0.25;
if( current_resample_factor > 4 ) current_resample_factor = 4;
if( current_resample_factor < resample_lower_limit ) current_resample_factor = resample_lower_limit;
if( current_resample_factor > resample_upper_limit ) current_resample_factor = resample_upper_limit;
// Now Calculate how many samples we need.
rlen = ceil( ((double)nframes) * current_resample_factor )+2;
......@@ -666,6 +668,8 @@ int main (int argc, char *argv[]) {
sample_rate = jack_sample_rate;
static_resample_factor = (double) sample_rate / (double) jack_sample_rate;
resample_lower_limit = static_resample_factor * 0.25;
resample_upper_limit = static_resample_factor * 4.0;
resample_mean = static_resample_factor;
offset_array = malloc( sizeof(double) * smooth_size );
......
Supports Markdown
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