commit | f450ced74677ea8ce4bb5c3c1fd12dfcf26fe928 | [log] [tgz] |
---|---|---|
author | Mikhail Naganov <mnaganov@google.com> | Fri May 10 13:30:40 2024 -0700 |
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | Wed May 22 17:38:22 2024 +0000 |
tree | e1addfe934707e9bec043c9100d1399a7efc8b45 | |
parent | bcf7dcb85a95884e70be98a309cb40c8721f77d7 [diff] [blame] |
Clean up HAL render position reporting Since AIDL HAL reports 64-bit position values, move the logic for proper expansion of 32-bit positions from AudioStreamOut into StreamOutHidl. Add synchronization which did not exist in AudioStreamOut. This is because the calling code does not always use same mutexes when calling into relevant methods, thus data races are possible. Also, clean up StreamOutHalInterface and AudioStreamOut interface by removing obsolete methods. Bug: 338557486 Test: atest CtsMediaAudioTestCases (cherry picked from https://android-review.googlesource.com/q/commit:0ea58fe84db5c97a905dfbd0be718eef325b049e) Merged-In: I30701af589f3721b3d8bf7886acc251ceefadc46 Change-Id: I30701af589f3721b3d8bf7886acc251ceefadc46
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 41914e3..a0485ce 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp
@@ -3398,9 +3398,9 @@ return NO_ERROR; } else { status_t status; - uint32_t frames; + uint64_t frames = 0; status = mOutput->getRenderPosition(&frames); - *dspFrames = (size_t)frames; + *dspFrames = (uint32_t)frames; return status; } }