AudioFlinger: Do not permit fast patch tracks if not compatible
Test: atest AudioPlaybackCaptureTest
Bug: 132346038
Change-Id: I67939ed7f98c546d41148d36764d93723353c893
diff --git a/services/audioflinger/PatchPanel.cpp b/services/audioflinger/PatchPanel.cpp
index a210a6d..edb331d 100644
--- a/services/audioflinger/PatchPanel.cpp
+++ b/services/audioflinger/PatchPanel.cpp
@@ -506,7 +506,10 @@
}
if (mPlayback.thread()->hasFastMixer()) {
// Create a fast track if the playback thread has fast mixer to get better performance.
+ // Note: we should have matching channel mask, sample rate, and format by the logic above.
outputFlags = (audio_output_flags_t) (outputFlags | AUDIO_OUTPUT_FLAG_FAST);
+ } else {
+ outputFlags = (audio_output_flags_t) (outputFlags & ~AUDIO_OUTPUT_FLAG_FAST);
}
// create a special playback track to render to playback thread.