Merge "r_submix: keep the signed value for offset calculation in AIDL implementation" into main am: bc2537e41f am: 2f8e3077fe am: 1b44653d3b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2721915
Change-Id: I44daa4b201b83d7706476aa49e61a61e888ad55a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp b/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
index 11838f8..3134b86 100644
--- a/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
+++ b/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
@@ -348,9 +348,9 @@
// recording (including this call): it's converted to usec and compared to how long we've been
// recording for, which gives us how long we must wait to sync the projected recording time, and
// the observed recording time.
- const size_t projectedVsObservedOffsetUs = static_cast<size_t>(
+ const int projectedVsObservedOffsetUs =
std::roundf((readCounterFrames * MICROS_PER_SECOND / mStreamConfig.sampleRate) -
- recordDurationUs.count()));
+ recordDurationUs.count());
LOG(VERBOSE) << __func__ << ": record duration " << recordDurationUs.count()
<< " microseconds, will wait: " << projectedVsObservedOffsetUs << " microseconds";