Merge "SoundPool: Fix channel mask reporting" am: 4b50dd4f0e am: 82c42ad3ef

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2203298

Change-Id: I019b0295720a29a1270802b07b670d27d6476102
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Andy Hung
2022-09-02 22:58:41 +00:00
committed by Automerger Merge Worker

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)) {
return UNKNOWN_ERROR;
}
if (!AMediaFormat_getInt32(format.get(), AMEDIAFORMAT_KEY_CHANNEL_MASK,
(int32_t*) channelMask)) {
int32_t mediaFormatChannelMask;
if (AMediaFormat_getInt32(format.get(), AMEDIAFORMAT_KEY_CHANNEL_MASK,
&mediaFormatChannelMask)) {
*channelMask = audio_channel_mask_from_media_format_mask(mediaFormatChannelMask);
} else {
*channelMask = AUDIO_CHANNEL_NONE;
}
*sizeInBytes = written;