diff options
-rw-r--r-- | Alc/converter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/converter.c b/Alc/converter.c index 558f5e40..20789135 100644 --- a/Alc/converter.c +++ b/Alc/converter.c @@ -219,7 +219,7 @@ ALsizei SampleConverterAvailableOut(SampleConverter *converter, ALsizei srcframe DataSize64 -= DataPosFrac; /* If we have a full prep, we can generate at least one sample. */ - return (ALsizei)clampu64(DataSize64/increment, 1, INT_MAX); + return (ALsizei)clampu64((DataSize64 + increment-1)/increment, 1, BUFFERSIZE); } @@ -283,7 +283,7 @@ ALsizei SampleConverterInput(SampleConverter *converter, const ALvoid **src, ALs DataSize64 -= DataPosFrac; /* If we have a full prep, we can generate at least one sample. */ - DstSize = (ALsizei)clampu64(DataSize64/increment, 1, BUFFERSIZE); + DstSize = (ALsizei)clampu64((DataSize64 + increment-1)/increment, 1, BUFFERSIZE); DstSize = mini(DstSize, dstframes-pos); for(chan = 0;chan < converter->mNumChannels;chan++) |