diff options
| author | 2022-09-01 16:52:47 +0000 | |
|---|---|---|
| committer | 2022-09-01 16:52:47 +0000 | |
| commit | 45eb28709a79e46a9ec7e49039951d555a023dde (patch) | |
| tree | c03ab1915bfe6123e4ca8b67a5a45ea0420a753e | |
| parent | 51eece2ac490e94039e7c9537a3554459cd99550 (diff) | |
| parent | b78f7a6525a230ce89c1bc516d4ed12892a3674f (diff) | |
Merge "SoundPool: Fix channel mask reporting" into tm-qpr-dev
| -rw-r--r-- | media/jni/soundpool/Sound.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/media/jni/soundpool/Sound.cpp b/media/jni/soundpool/Sound.cpp index ac5f35fd1e31..ecc44f483b67 100644 --- a/media/jni/soundpool/Sound.cpp +++ b/media/jni/soundpool/Sound.cpp @@ -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; |