Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b06277ef authored by Andy Hung's avatar Andy Hung
Browse files

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
parent 2cb1a8cc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -117,6 +117,11 @@ size_t RecordBufferConverter::convert(void *dst,
        // format convert to destination buffer
        convertResampler(dst, mBuf, frames);
    }
    // Release unused frames in the InputConverterProvider buffer so that
    // the RecordThread is able to properly account for consumed frames.
    if (mInputConverterProvider != nullptr) {
        mInputConverterProvider->reset();
    }
    return frames;
}