Unified · Split
| @@ -1,3 +1,13 @@ | |||
| 1 | 2005-08-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com> | ||
| 2 | |||
| 3 | * tests/termination_test.c | ||
| 4 | Rename term_test() to init_term_test() and add extra test functionality | ||
| 5 | to sanity test the first sample output after reset. | ||
| 6 | |||
| 7 | * src/src_zoh.c src/src_linear.c | ||
| 8 | Fix bug found by new test. Thanks Stas Sergeev for bringint this to my | ||
| 9 | attention. | ||
| 10 | |||
| 1 | 2005-08-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com> | 11 | 2005-08-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com> |
| 2 | 12 | ||
| 3 | * doc/Makefile.am | 13 | * doc/Makefile.am |
| @@ -53,7 +63,7 @@ · 49 unmodified lines | |||
| 53 | * configure.ac Win32/Makefile.mingw.in | 63 | * configure.ac Win32/Makefile.mingw.in |
| 54 | Add preliminary support for compiling on Win32 using MinGW. | 64 | Add preliminary support for compiling on Win32 using MinGW. |
| 55 | 65 | ||
| 56 | * configure.ac | 66 | * configure.ac |
| 57 | Bump version to 0.1.2. | 67 | Bump version to 0.1.2. |
| 58 | Add --enable-gcc-werror configure option. | 68 | Add --enable-gcc-werror configure option. |
| 59 | 69 | ||
| @@ -43,6 +43,7 @@ static void linear_reset (SRC_PRIVATE *psrc) ; · 42 unmodified lines | |||
| 43 | typedef struct | 43 | typedef struct |
| 44 | { int linear_magic_marker ; | 44 | { int linear_magic_marker ; |
| 45 | int channels ; | 45 | int channels ; |
| 46 | int reset ; | ||
| 46 | long in_count, in_used ; | 47 | long in_count, in_used ; |
| 47 | long out_count, out_gen ; | 48 | long out_count, out_gen ; |
| 48 | float last_value [1] ; | 49 | float last_value [1] ; |
| @@ -62,6 +63,13 @@ linear_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 13 unmodified lines | |||
| 62 | 63 | ||
| 63 | linear = (LINEAR_DATA*) psrc->private_data ; | 64 | linear = (LINEAR_DATA*) psrc->private_data ; |
| 64 | 65 | ||
| 66 | if (linear->reset) | ||
| 67 | { /* If we have just been reset, set the last_value data. */ | ||
| 68 | for (ch = 0 ; ch < linear->channels ; ch++) | ||
| 69 | linear->last_value [ch] = data->data_in [ch] ; | ||
| 70 | linear->reset = 0 ; | ||
| 71 | } ; | ||
| 72 | |||
| 65 | linear->in_count = data->input_frames * linear->channels ; | 73 | linear->in_count = data->input_frames * linear->channels ; |
| 66 | linear->out_count = data->output_frames * linear->channels ; | 74 | linear->out_count = data->output_frames * linear->channels ; |
| 67 | linear->in_used = linear->out_gen = 0 ; | 75 | linear->in_used = linear->out_gen = 0 ; |
| @@ -201,6 +209,9 @@ linear_reset (SRC_PRIVATE *psrc) · 133 unmodified lines | |||
| 201 | if (linear == NULL) | 209 | if (linear == NULL) |
| 202 | return ; | 210 | return ; |
| 203 | 211 | ||
| 212 | linear->channels = psrc->channels ; | ||
| 213 | linear->reset = 1 ; | ||
| 214 | |||
| 204 | memset (linear->last_value, 0, sizeof (linear->last_value [0]) * linear->channels) ; | 215 | memset (linear->last_value, 0, sizeof (linear->last_value [0]) * linear->channels) ; |
| 205 | } /* linear_reset */ | 216 | } /* linear_reset */ |
| 206 | /* | 217 | /* |
| @@ -41,6 +41,7 @@ static void zoh_reset (SRC_PRIVATE *psrc) ; · 40 unmodified lines | |||
| 41 | typedef struct | 41 | typedef struct |
| 42 | { int zoh_magic_marker ; | 42 | { int zoh_magic_marker ; |
| 43 | int channels ; | 43 | int channels ; |
| 44 | int reset ; | ||
| 44 | long in_count, in_used ; | 45 | long in_count, in_used ; |
| 45 | long out_count, out_gen ; | 46 | long out_count, out_gen ; |
| 46 | float last_value [1] ; | 47 | float last_value [1] ; |
| @@ -60,6 +61,13 @@ zoh_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 13 unmodified lines | |||
| 60 | 61 | ||
| 61 | zoh = (ZOH_DATA*) psrc->private_data ; | 62 | zoh = (ZOH_DATA*) psrc->private_data ; |
| 62 | 63 | ||
| 64 | if (zoh->reset) | ||
| 65 | { /* If we have just been reset, set the last_value data. */ | ||
| 66 | for (ch = 0 ; ch < zoh->channels ; ch++) | ||
| 67 | zoh->last_value [ch] = data->data_in [ch] ; | ||
| 68 | zoh->reset = 0 ; | ||
| 69 | } ; | ||
| 70 | |||
| 63 | zoh->in_count = data->input_frames * zoh->channels ; | 71 | zoh->in_count = data->input_frames * zoh->channels ; |
| 64 | zoh->out_count = data->output_frames * zoh->channels ; | 72 | zoh->out_count = data->output_frames * zoh->channels ; |
| 65 | zoh->in_used = zoh->out_gen = 0 ; | 73 | zoh->in_used = zoh->out_gen = 0 ; |
| @@ -194,6 +202,7 @@ zoh_reset (SRC_PRIVATE *psrc) · 128 unmodified lines | |||
| 194 | return ; | 202 | return ; |
| 195 | 203 | ||
| 196 | zoh->channels = psrc->channels ; | 204 | zoh->channels = psrc->channels ; |
| 205 | zoh->reset = 1 ; | ||
| 197 | memset (zoh->last_value, 0, sizeof (zoh->last_value [0]) * zoh->channels) ; | 206 | memset (zoh->last_value, 0, sizeof (zoh->last_value [0]) * zoh->channels) ; |
| 198 | 207 | ||
| 199 | return ; | 208 | return ; |