Skip to content

Commit

Permalink
Fix audio resampling in some cases.
Browse files Browse the repository at this point in the history
Fixes Bugzilla #2389.
  • Loading branch information
icculus committed Jun 10, 2014
1 parent 78d40e0 commit 91b7fb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/audio/sdlgenaudiocvt.pl
Expand Up @@ -383,6 +383,7 @@ sub buildArbitraryResampleFunc {
my $eps_adjust = ($upsample) ? 'dstsize' : 'srcsize';
my $incr = '';
my $incr2 = '';
my $block_align = $channels * $fsize/8;


# !!! FIXME: DEBUG_CONVERT should report frequencies.
Expand All @@ -395,7 +396,7 @@ sub buildArbitraryResampleFunc {
#endif
const int srcsize = cvt->len_cvt - $fudge;
const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
const int dstsize = (int) (((double)(cvt->len_cvt/${block_align})) * cvt->rate_incr) * ${block_align};
register int eps = 0;
EOF

Expand Down

0 comments on commit 91b7fb0

Please sign in to comment.