SoundPool: Fix channel mask reporting

Test: atest SoundPoolAacTest and check logcat
Bug: 243906444
Change-Id: I5231f989183300a6b2354bbd4bbca991b1e70cb8
This commit is contained in:
Andy Hung
2022-08-29 20:10:03 -07:00
parent 88684d2dd3
commit b78f7a6525

View File

@@ -181,8 +181,11 @@ static status_t decode(int fd, int64_t offset, int64_t length,
format.get(), AMEDIAFORMAT_KEY_CHANNEL_COUNT, channelCount)) { format.get(), AMEDIAFORMAT_KEY_CHANNEL_COUNT, channelCount)) {
return UNKNOWN_ERROR; return UNKNOWN_ERROR;
} }
if (!AMediaFormat_getInt32(format.get(), AMEDIAFORMAT_KEY_CHANNEL_MASK, int32_t mediaFormatChannelMask;
(int32_t*) channelMask)) { if (AMediaFormat_getInt32(format.get(), AMEDIAFORMAT_KEY_CHANNEL_MASK,
&mediaFormatChannelMask)) {
*channelMask = audio_channel_mask_from_media_format_mask(mediaFormatChannelMask);
} else {
*channelMask = AUDIO_CHANNEL_NONE; *channelMask = AUDIO_CHANNEL_NONE;
} }
*sizeInBytes = written; *sizeInBytes = written;