AudioFlinger: Remove latency reporting for AUDIO_INPUT_FLAG_HW_AV_SYNC
Test: No regression
Bug: 117299316
Change-Id: I8f7c70454baf93f36e87ea98ba795beea8d75678
diff --git a/services/audioflinger/RecordTracks.h b/services/audioflinger/RecordTracks.h
index b0c9fda..85f5456 100644
--- a/services/audioflinger/RecordTracks.h
+++ b/services/audioflinger/RecordTracks.h
@@ -71,6 +71,12 @@
status_t getActiveMicrophones(std::vector<media::MicrophoneInfo>* activeMicrophones);
+ static bool checkServerLatencySupported(
+ audio_format_t format, audio_input_flags_t flags) {
+ return audio_is_linear_pcm(format)
+ && (flags & AUDIO_INPUT_FLAG_HW_AV_SYNC) == 0;
+ }
+
private:
friend class AudioFlinger; // for mState
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 01c5ea2..f42c882 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -7528,7 +7528,7 @@
(void)input->stream->dump(fd);
}
- const double latencyMs = audio_is_linear_pcm(mFormat)
+ const double latencyMs = RecordTrack::checkServerLatencySupported(mFormat, input->flags)
? - mTimestamp.getOutputServerLatencyMs(mSampleRate) : 0.;
if (latencyMs != 0.) {
dprintf(fd, " NormalRecord latency ms: %.2lf\n", latencyMs);
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index a99bbe1..ed48284 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -1755,7 +1755,7 @@
thread->mFastTrackAvail = false;
} else {
// TODO: only Normal Record has timestamps (Fast Record does not).
- mServerLatencySupported = audio_is_linear_pcm(mFormat);
+ mServerLatencySupported = checkServerLatencySupported(mFormat, flags);
}
#ifdef TEE_SINK
mTee.setId(std::string("_") + std::to_string(mThreadIoHandle)