Skip to content

Commit

Permalink
This somehow aligns with decode lengths?!
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Jan 3, 2019
1 parent 838e601 commit a770349
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/FAudio_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,12 @@ static void FAudio_INTERNAL_MixSource(FAudioSourceVoice *voice)
toResample = toDecode << FIXED_PRECISION;
/* ... round back down based on current offset... */
toResample -= voice->src.curBufferOffsetDec;
/* ... but also ceil for any fraction value... */
toResample += FIXED_FRACTION_MASK;
/* ... undo step size, fixed to int. */
toResample /= voice->src.resampleStep;
/* Add the padding, for some reason this helps? */
toResample += EXTRA_DECODE_PADDING;
/* FIXME: I feel like this should be an assert but I suck */
toResample = FAudio_min(toResample, voice->src.resampleSamples);

Expand Down

0 comments on commit a770349

Please sign in to comment.