Bug 1656438 - Report pre-buffer as current buffer size before receiving data in DynamicResampler. r=padenot

Without this patch we return 0, and that can be misinterpreted by
AudioDriftCorrection so it thinks we have drifted a lot. This becomes more
obvious with a large desired buffer.

Differential Revision: https://phabricator.services.mozilla.com/D89759
This commit is contained in:
Andreas Pehrson 2020-09-15 14:42:06 +00:00
parent 38e987ad7e
commit 4d7b23d775

View File

@ -455,7 +455,7 @@ void AudioResampler::Update(int aOutRate, int aChannels) {
int AudioResampler::InputDuration() const {
if (!mIsSampleFormatSet) {
return 0;
return (int)mResampler.mPreBufferFrames;
}
MOZ_ASSERT((int)mResampler.InFramesBuffered(0) >= 0);
return (int)mResampler.InFramesBuffered(0);