audio: fix aac offload
Fix AAC format checks broken when
AAC sub types were added.
Change-Id: Ifef2ee24e0375eb92f758f034995f3d496baf2c6
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index f627772..10dcd4d 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -142,10 +142,15 @@
static bool is_supported_format(audio_format_t format)
{
- if (format == AUDIO_FORMAT_MP3 ||
- format == AUDIO_FORMAT_AAC)
- return true;
-
+ switch (format) {
+ case AUDIO_FORMAT_MP3:
+ case AUDIO_FORMAT_AAC_LC:
+ case AUDIO_FORMAT_AAC_HE_V1:
+ case AUDIO_FORMAT_AAC_HE_V2:
+ return true;
+ default:
+ break;
+ }
return false;
}
@@ -153,7 +158,7 @@
{
int id = 0;
- switch (format) {
+ switch (format & AUDIO_FORMAT_MAIN_MASK) {
case AUDIO_FORMAT_MP3:
id = SND_AUDIOCODEC_MP3;
break;