mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-10 23:02:01 +00:00
reset samplefrac to 8-bits, to prevent overflow
issue: https://github.com/ioquake/ioq3/issues/106
This commit is contained in:
parent
1246d16834
commit
2ef641b969
1 changed files with 6 additions and 2 deletions
|
@ -126,13 +126,15 @@ static int ResampleSfx( sfx_t *sfx, int channels, int inrate, int inwidth, int s
|
|||
|
||||
outcount = samples / stepscale;
|
||||
|
||||
srcsample = 0;
|
||||
samplefrac = 0;
|
||||
fracstep = stepscale * 256 * channels;
|
||||
chunk = sfx->soundData;
|
||||
|
||||
for (i=0 ; i<outcount ; i++)
|
||||
{
|
||||
srcsample = samplefrac >> 8;
|
||||
srcsample += samplefrac >> 8;
|
||||
samplefrac &= 255;
|
||||
samplefrac += fracstep;
|
||||
for (j=0 ; j<channels ; j++)
|
||||
{
|
||||
|
@ -178,12 +180,14 @@ static int ResampleSfxRaw( short *sfx, int channels, int inrate, int inwidth, in
|
|||
|
||||
outcount = samples / stepscale;
|
||||
|
||||
srcsample = 0;
|
||||
samplefrac = 0;
|
||||
fracstep = stepscale * 256 * channels;
|
||||
|
||||
for (i=0 ; i<outcount ; i++)
|
||||
{
|
||||
srcsample = samplefrac >> 8;
|
||||
srcsample += samplefrac >> 8;
|
||||
samplefrac &= 255;
|
||||
samplefrac += fracstep;
|
||||
for (j=0 ; j<channels ; j++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue