Skip to content

Commit b06277e

Browse files
committed
RecordBufferConverter: Release converter buffer after conversion
Required to ensure the RecordThread understands the true number of frames consumed / available. Otherwise the RecordThread thinks there are more frames than actually present, causing a buffer provider underrun in the AudioResampler and the resampler to reset. Test: BT phone call, Tee sink Bug: 130419319 Change-Id: I96fac6f52233e8519c0cc098329e5b9b89c1dd89
1 parent 2cb1a8c commit b06277e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

media/libaudioprocessing/RecordBufferConverter.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ size_t RecordBufferConverter::convert(void *dst,
117117
// format convert to destination buffer
118118
convertResampler(dst, mBuf, frames);
119119
}
120+
// Release unused frames in the InputConverterProvider buffer so that
121+
// the RecordThread is able to properly account for consumed frames.
122+
if (mInputConverterProvider != nullptr) {
123+
mInputConverterProvider->reset();
124+
}
120125
return frames;
121126
}
122127

0 commit comments

Comments
 (0)