Simplify AudioRecord::getInputFramesLost()
This also fixes a benign race in reading mActive without a lock.
Change-Id: I19e953d4f275e5c266ca1ca3fece7b6c02ad1707
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index f8813c9..01ce2a4 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -432,10 +432,8 @@
unsigned int AudioRecord::getInputFramesLost() const
{
- if (mActive)
- return AudioSystem::getInputFramesLost(mInput);
- else
- return 0;
+ // no need to check mActive, because if inactive this will return 0, which is what we want
+ return AudioSystem::getInputFramesLost(mInput);
}
// -------------------------------------------------------------------------