Unified · Split
| @@ -3,6 +3,16 @@ · 2 unmodified lines | ||
| 3 | 3 | * src/samplerate.c |
| 4 | 4 | Refactor checking of supplied src ratio against min and max. |
| 5 | 5 | |
| 6 | + * configure.ac | |
| 7 | + Remove -pendantic from CFLAGS and add -std=gnu99. | |
| 8 | + | |
| 9 | + * tests/callback_hang_test.c tests/Makefile.am | |
| 10 | + Add new test program and hook it into build. | |
| 11 | + | |
| 12 | + * src/src_linear.c src/src_sinc.c src/src_zoh.c | |
| 13 | + Fix a bug where the src_callback_read () function would hang under varying | |
| 14 | + src_ratio. | |
| 15 | + | |
| 6 | 16 | 2007-01-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com> |
| 7 | 17 | |
| 8 | 18 | * doc/api.html doc/api_callback.html doc/api_misc.html |
| @@ -83,8 +83,8 @@ linear_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 82 unmodified lines | ||
| 83 | 83 | if (linear->in_used + linear->channels * input_index > linear->in_count) |
| 84 | 84 | break ; |
| 85 | 85 | |
| 86 | − if (fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF) | |
| 87 | − src_ratio = psrc->last_ratio + linear->out_gen * (data->src_ratio - psrc->last_ratio) / (linear->out_count - 1) ; | |
| 86 | + if (linear->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF) | |
| 87 | + src_ratio = psrc->last_ratio + linear->out_gen * (data->src_ratio - psrc->last_ratio) / linear->out_count ; | |
| 88 | 88 | |
| 89 | 89 | for (ch = 0 ; ch < linear->channels ; ch++) |
| 90 | 90 | { data->data_out [linear->out_gen] = (float) (linear->last_value [ch] + input_index * |
| @@ -103,8 +103,8 @@ linear_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 12 unmodified lines | ||
| 103 | 103 | /* Main processing loop. */ |
| 104 | 104 | while (linear->out_gen < linear->out_count && linear->in_used + linear->channels * input_index <= linear->in_count) |
| 105 | 105 | { |
| 106 | − if (fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF) | |
| 107 | − src_ratio = psrc->last_ratio + linear->out_gen * (data->src_ratio - psrc->last_ratio) / (linear->out_count - 1) ; | |
| 106 | + if (linear->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF) | |
| 107 | + src_ratio = psrc->last_ratio + linear->out_gen * (data->src_ratio - psrc->last_ratio) / linear->out_count ; | |
| 108 | 108 | |
| 109 | 109 | if (SRC_DEBUG && linear->in_used < linear->channels && input_index < 1.0) |
| 110 | 110 | { printf ("Whoops!!!! in_used : %ld channels : %d input_index : %f\n", linear->in_used, linear->channels, input_index) ; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | −** Copyright (C) 2002-2006 Erik de Castro Lopo <erikd@mega-nerd.com> | |
| 2 | +** Copyright (C) 2002-2007 Erik de Castro Lopo <erikd@mega-nerd.com> | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or modify |
| 5 | 5 | ** it under the terms of the GNU General Public License as published by |
| @@ -307,8 +307,8 @@ sinc_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 301 unmodified lines | ||
| 307 | 307 | break ; |
| 308 | 308 | } ; |
| 309 | 309 | |
| 310 | − if (fabs (psrc->last_ratio - data->src_ratio) > 1e-10) | |
| 311 | − src_ratio = psrc->last_ratio + filter->out_gen * (data->src_ratio - psrc->last_ratio) / (filter->out_count - 1) ; | |
| 310 | + if (filter->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > 1e-10) | |
| 311 | + src_ratio = psrc->last_ratio + filter->out_gen * (data->src_ratio - psrc->last_ratio) / filter->out_count ; | |
| 312 | 312 | |
| 313 | 313 | float_increment = filter->index_inc * 1.0 ; |
| 314 | 314 | if (src_ratio < 1.0) |
| @@ -466,11 +466,3 @@ calc_output (SINC_FILTER *filter, increment_t increment, increment_t start_filte · 151 unmodified lines | ||
| 466 | 466 | return (left + right) ; |
| 467 | 467 | } /* calc_output */ |
| 468 | 468 | |
| 469 | −/* | |
| 470 | −** Do not edit or modify anything in this comment block. | |
| 471 | −** The arch-tag line is a file identity tag for the GNU Arch | |
| 472 | −** revision control system. | |
| 473 | −** | |
| 474 | −** arch-tag: db8efe06-2fbd-487e-be8f-bfc01e68c19f | |
| 475 | −*/ | |
| 476 | − | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | −** Copyright (C) 2002-2006 Erik de Castro Lopo <erikd@mega-nerd.com> | |
| 2 | +** Copyright (C) 2002-2007 Erik de Castro Lopo <erikd@mega-nerd.com> | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or modify |
| 5 | 5 | ** it under the terms of the GNU General Public License as published by |
| @@ -81,8 +81,8 @@ zoh_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 75 unmodified lines | ||
| 81 | 81 | if (zoh->in_used + zoh->channels * input_index >= zoh->in_count) |
| 82 | 82 | break ; |
| 83 | 83 | |
| 84 | − if (fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF) | |
| 85 | − src_ratio = psrc->last_ratio + zoh->out_gen * (data->src_ratio - psrc->last_ratio) / (zoh->out_count - 1) ; | |
| 84 | + if (zoh->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF) | |
| 85 | + src_ratio = psrc->last_ratio + zoh->out_gen * (data->src_ratio - psrc->last_ratio) / zoh->out_count ; | |
| 86 | 86 | |
| 87 | 87 | for (ch = 0 ; ch < zoh->channels ; ch++) |
| 88 | 88 | { data->data_out [zoh->out_gen] = zoh->last_value [ch] ; |
| @@ -100,8 +100,8 @@ zoh_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 11 unmodified lines | ||
| 100 | 100 | /* Main processing loop. */ |
| 101 | 101 | while (zoh->out_gen < zoh->out_count && zoh->in_used + zoh->channels * input_index <= zoh->in_count) |
| 102 | 102 | { |
| 103 | − if (fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF) | |
| 104 | − src_ratio = psrc->last_ratio + zoh->out_gen * (data->src_ratio - psrc->last_ratio) / (zoh->out_count - 1) ; | |
| 103 | + if (zoh->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF) | |
| 104 | + src_ratio = psrc->last_ratio + zoh->out_gen * (data->src_ratio - psrc->last_ratio) / zoh->out_count ; | |
| 105 | 105 | |
| 106 | 106 | for (ch = 0 ; ch < zoh->channels ; ch++) |
| 107 | 107 | { data->data_out [zoh->out_gen] = data->data_in [zoh->in_used - zoh->channels + ch] ; |
| @@ -208,11 +208,4 @@ zoh_reset (SRC_PRIVATE *psrc) · 100 unmodified lines | ||
| 208 | 208 | |
| 209 | 209 | return ; |
| 210 | 210 | } /* zoh_reset */ |
| 211 | −/* | |
| 212 | −** Do not edit or modify anything in this comment block. | |
| 213 | −** The arch-tag line is a file identity tag for the GNU Arch | |
| 214 | −** revision control system. | |
| 215 | −** | |
| 216 | −** arch-tag: 808e62f8-2e4a-44a6-840f-180a3e41af01 | |
| 217 | −*/ | |
| 218 | 211 | |