audio policy: fix HW A/V sync output selection
commit b732cf5a broke the selection mechanism for the
HW A/V sync direct output.
Add a rule to only select a mixed output for basic PCM
stereo content when a direct output is not explicitly requested.
Bug: 17702382.
Change-Id: I1387690ace77cd4d6a8faf0b525c3d1008fba3f1
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp
index d0b990f..536987a 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/AudioPolicyManager.cpp
@@ -930,7 +930,9 @@
sp<IOProfile> profile;
// skip direct output selection if the request can obviously be attached to a mixed output
- if (audio_is_linear_pcm(format) && samplingRate <= MAX_MIXER_SAMPLING_RATE &&
+ // and not explicitly requested
+ if (((flags & AUDIO_OUTPUT_FLAG_DIRECT) == 0) &&
+ audio_is_linear_pcm(format) && samplingRate <= MAX_MIXER_SAMPLING_RATE &&
audio_channel_count_from_out_mask(channelMask) <= 2) {
goto non_direct_output;
}