Merge "RecordBufferConverter: Release converter buffer after conversion" into qt-dev
diff --git a/media/libaudioprocessing/RecordBufferConverter.cpp b/media/libaudioprocessing/RecordBufferConverter.cpp
index 54151f5..7d6fe72 100644
--- a/media/libaudioprocessing/RecordBufferConverter.cpp
+++ b/media/libaudioprocessing/RecordBufferConverter.cpp
@@ -117,6 +117,11 @@
         // 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;
 }