mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-07 07:30:02 +01:00
bugfix: flush() didn't properly flush final samples from the pipeline on 2nd time, in case that soundtouch object instance were recycled and used for processing a 2nd audio stream.
This commit is contained in:
parent
9287800b65
commit
882f248a0c
@ -359,6 +359,7 @@ void SoundTouch::flush()
|
|||||||
|
|
||||||
// how many samples are still expected to output
|
// how many samples are still expected to output
|
||||||
numStillExpected = (int)((long)(samplesExpectedOut + 0.5) - samplesOutput);
|
numStillExpected = (int)((long)(samplesExpectedOut + 0.5) - samplesOutput);
|
||||||
|
if (numStillExpected < 0) numStillExpected = 0;
|
||||||
|
|
||||||
memset(buff, 0, 128 * channels * sizeof(SAMPLETYPE));
|
memset(buff, 0, 128 * channels * sizeof(SAMPLETYPE));
|
||||||
// "Push" the last active samples out from the processing pipeline by
|
// "Push" the last active samples out from the processing pipeline by
|
||||||
@ -477,6 +478,7 @@ int SoundTouch::getSetting(int settingId) const
|
|||||||
void SoundTouch::clear()
|
void SoundTouch::clear()
|
||||||
{
|
{
|
||||||
samplesExpectedOut = 0;
|
samplesExpectedOut = 0;
|
||||||
|
samplesOutput = 0;
|
||||||
pRateTransposer->clear();
|
pRateTransposer->clear();
|
||||||
pTDStretch->clear();
|
pTDStretch->clear();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user