diff options
author | Glenn Kasten <gkasten@google.com> | 2012-07-12 09:07:11 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-07-12 09:36:34 -0700 |
commit | bf04a5d7f287fc712e0ed91849dc85c90c1e182d (patch) | |
tree | f9fd2ffd8df5a02c9c9373f5362da76204e5a676 /media | |
parent | 39c54f68804c1ce5c85ec588f3c2c63447a807b4 (diff) | |
download | frameworks_av-bf04a5d7f287fc712e0ed91849dc85c90c1e182d.zip frameworks_av-bf04a5d7f287fc712e0ed91849dc85c90c1e182d.tar.gz frameworks_av-bf04a5d7f287fc712e0ed91849dc85c90c1e182d.tar.bz2 |
Simplify AudioRecord::getInputFramesLost()
This also fixes a benign race in reading mActive without a lock.
Change-Id: I19e953d4f275e5c266ca1ca3fece7b6c02ad1707
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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 @@ status_t AudioRecord::getPosition(uint32_t *position) const 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); } // ------------------------------------------------------------------------- |