Browse Source

Apply srcfactor.diff patch for ticket #162.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3962 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/v1.9.6
sletz 15 years ago
parent
commit
8d904fe3ec
3 changed files with 14 additions and 5 deletions
  1. +2
    -1
      ChangeLog
  2. +6
    -2
      example-clients/alsa_in.c
  3. +6
    -2
      example-clients/alsa_out.c

+ 2
- 1
ChangeLog View File

@@ -32,7 +32,8 @@ Arnold Krille


2010-03-19 Stephane Letz <letz@grame.fr> 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> 2010-03-06 Stephane Letz <letz@grame.fr>


+ 6
- 2
example-clients/alsa_in.c View File

@@ -38,6 +38,8 @@ int jack_buffer_size;
int quit = 0; int quit = 0;
double resample_mean = 1.0; double resample_mean = 1.0;
double static_resample_factor = 1.0; double static_resample_factor = 1.0;
double resample_lower_limit = 0.25;
double resample_upper_limit = 4.0;


double *offset_array; double *offset_array;
double *window_array; double *window_array;
@@ -388,8 +390,8 @@ int process (jack_nframes_t nframes, void *arg) {
output_offset = (float) offset; output_offset = (float) offset;


// Clamp a bit. // 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. // Now Calculate how many samples we need.
rlen = ceil( ((double)nframes) / current_resample_factor )+2; 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 ); printf( "selected sample format: %s\n", formats[format].name );


static_resample_factor = (double) jack_sample_rate / (double) sample_rate; 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; resample_mean = static_resample_factor;


offset_array = malloc( sizeof(double) * smooth_size ); offset_array = malloc( sizeof(double) * smooth_size );


+ 6
- 2
example-clients/alsa_out.c View File

@@ -37,6 +37,8 @@ int jack_buffer_size;


double resample_mean = 1.0; double resample_mean = 1.0;
double static_resample_factor = 1.0; double static_resample_factor = 1.0;
double resample_lower_limit = 0.25;
double resample_upper_limit = 4.0;


double *offset_array; double *offset_array;
double *window_array; double *window_array;
@@ -395,8 +397,8 @@ int process (jack_nframes_t nframes, void *arg) {
output_offset = (float) offset; output_offset = (float) offset;


// Clamp a bit. // 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. // Now Calculate how many samples we need.
rlen = ceil( ((double)nframes) * current_resample_factor )+2; rlen = ceil( ((double)nframes) * current_resample_factor )+2;
@@ -666,6 +668,8 @@ int main (int argc, char *argv[]) {
sample_rate = jack_sample_rate; sample_rate = jack_sample_rate;


static_resample_factor = (double) sample_rate / (double) 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; resample_mean = static_resample_factor;


offset_array = malloc( sizeof(double) * smooth_size ); offset_array = malloc( sizeof(double) * smooth_size );


Loading…
Cancel
Save