Fix the format used by ThreadBase::toAudioPortConfig
Since 'toAudioPortConfig' is used to communicate to the HAL,
the emitted port config specification must use the HAL
audio format, not the processing format. This is consistent
with use of the 'format()' getter in other code, as it
also returns the HAL format.
Bug: 298175108
Test: atest audiosystem_tests
Change-Id: I4a09a9f312a1415f7dcb7381a8198a9d60467388
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 09583aa..da9a900 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -1801,7 +1801,7 @@
config->type = AUDIO_PORT_TYPE_MIX;
config->ext.mix.handle = mId;
config->sample_rate = mSampleRate;
- config->format = mFormat;
+ config->format = mHALFormat;
config->channel_mask = mChannelMask;
config->config_mask = AUDIO_PORT_CONFIG_SAMPLE_RATE|AUDIO_PORT_CONFIG_CHANNEL_MASK|
AUDIO_PORT_CONFIG_FORMAT;