From 4067d907c8a91d841c68d7bcc8e45e9d373717c1 Mon Sep 17 00:00:00 2001 From: Jonathan Campbell Date: Tue, 10 Oct 2017 13:14:40 -0700 Subject: [PATCH] fix resample step calculation. 32-bit builds broke (with step == 0) because of typecasting to unsigned long. --- media/dosamp/dosamp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/media/dosamp/dosamp.c b/media/dosamp/dosamp.c index 535b8e6fd..8e431384f 100644 --- a/media/dosamp/dosamp.c +++ b/media/dosamp/dosamp.c @@ -1722,12 +1722,12 @@ int negotiate_play_format(struct wav_cbr_t * const d,const struct wav_cbr_t * co d->bytes_per_block = ((d->bits_per_sample+7U)/8U) * d->number_of_channels; { - unsigned long long tmp; + resample_intermediate_t tmp; - tmp = (unsigned long long)s->sample_rate << (unsigned long long)resample_100_shift; - tmp /= (unsigned long long)d->sample_rate; + tmp = (resample_intermediate_t)s->sample_rate << (resample_intermediate_t)resample_100_shift; + tmp /= (resample_intermediate_t)d->sample_rate; - resample_step = (unsigned long)tmp; + resample_step = tmp; resample_frac = 0; }