PatchPanel: Fix typo in patch validation
This piece of logic does not seem to be correct:
(patch->sinks[i].type == AUDIO_PORT_TYPE_MIX ||
patch->sinks[i].ext.mix.hw_module != srcModule)
I assume it should be:
(patch->sinks[i].type == AUDIO_PORT_TYPE_MIX ||
(patch->sinks[i].type == AUDIO_PORT_TYPE_DEVICE &&
patch->sinks[i].ext.device.hw_module != srcModule)
Was working fine because 'hw_module' is the first field both
in audio_port_config_device_ext and audio_port_config_mix_ext.
Test: make
Change-Id: Icf80cec701048bddc4d63eaedf00fc75b5b891dd
diff --git a/services/audioflinger/PatchPanel.cpp b/services/audioflinger/PatchPanel.cpp
index eaf1120..adefd4b 100644
--- a/services/audioflinger/PatchPanel.cpp
+++ b/services/audioflinger/PatchPanel.cpp
@@ -178,8 +178,10 @@
for (unsigned int i = 0; i < patch->num_sinks; i++) {
// support only one sink if connection to a mix or across HW modules
if ((patch->sinks[i].type == AUDIO_PORT_TYPE_MIX ||
- patch->sinks[i].ext.mix.hw_module != srcModule) &&
+ (patch->sinks[i].type == AUDIO_PORT_TYPE_DEVICE &&
+ patch->sinks[i].ext.device.hw_module != srcModule)) &&
patch->num_sinks > 1) {
+ ALOGW("%s() multiple sinks for mix or across modules not supported", __func__);
status = INVALID_OPERATION;
goto exit;
}