Skip to content

Commit

Permalink
fix resample step calculation. 32-bit builds broke (with step == 0)
Browse files Browse the repository at this point in the history
because of typecasting to unsigned long.
  • Loading branch information
joncampbell123 committed Oct 10, 2017
1 parent ea2f88d commit 4067d90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions media/dosamp/dosamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4067d90

Please sign in to comment.