diff --git a/dumb/src/helpers/resamp3.inc b/dumb/src/helpers/resamp3.inc index 1581e7bfa..05c0dfbb7 100644 --- a/dumb/src/helpers/resamp3.inc +++ b/dumb/src/helpers/resamp3.inc @@ -124,13 +124,12 @@ int32 dumb_resample(DUMB_RESAMPLER *resampler, sample_t *dst, int32 dst_size, VO todo_clocks_set = todo_clocks; if ( todo_clocks_set > 256 * 65536 ) todo_clocks_set = 256 * 65536; todo_clocks -= todo_clocks_set; - todo = ( todo_clocks_set - resampler->last_clock + inv_dt - 1 ) / inv_dt; - if ( todo < 0 ) todo = 0; - LOOP4(todo, + while ( resampler->last_clock < todo_clocks_set ) + { POKE_ALIAS(2); pos--; x -= SRC_CHANNELS; - ); + } todo = todo_clocks_set >> 16; MIX_ALIAS( todo ); } @@ -229,13 +228,12 @@ int32 dumb_resample(DUMB_RESAMPLER *resampler, sample_t *dst, int32 dst_size, VO todo_clocks_set = todo_clocks; if ( todo_clocks_set > 256 * 65536 ) todo_clocks_set = 256 * 65536; todo_clocks -= todo_clocks_set; - todo = ( todo_clocks_set - resampler->last_clock + inv_dt - 1 ) / inv_dt; - if ( todo < 0 ) todo = 0; - LOOP4(todo, + while ( resampler->last_clock < todo_clocks_set ) + { POKE_ALIAS(-2); pos++; x += SRC_CHANNELS; - ); + } todo = todo_clocks_set >> 16; MIX_ALIAS( todo ); } diff --git a/dumb/src/helpers/resample.c b/dumb/src/helpers/resample.c index e78d0d39c..4424a4934 100644 --- a/dumb/src/helpers/resample.c +++ b/dumb/src/helpers/resample.c @@ -117,9 +117,9 @@ int dumb_resampling_quality = DUMB_RQ_CUBIC; */ #define LOOP4(iterator, CONTENT) \ { \ - while (iterator) { \ + while ( (iterator)-- ) \ + { \ CONTENT; \ - (iterator)--; \ } \ } #endif diff --git a/dumb/src/it/itrender.c b/dumb/src/it/itrender.c index 4d188ae6a..b8d4b5e92 100644 --- a/dumb/src/it/itrender.c +++ b/dumb/src/it/itrender.c @@ -4863,7 +4863,7 @@ static DUMB_IT_SIGRENDERER *init_sigrenderer(DUMB_IT_SIGDATA *sigdata, int n_cha channel->channelvolume = sigdata->channel_volume[i]; channel->instrument = 0; channel->sample = 0; - channel->note = 0; + channel->note = IT_NOTE_OFF; channel->SFmacro = 0; channel->filter_cutoff = 127; channel->filter_resonance = 0;