diff options
| author | Glenn Kasten <gkasten@google.com> | 2014-03-07 12:31:03 -0800 |
|---|---|---|
| committer | Glenn Kasten <gkasten@google.com> | 2014-03-07 12:32:14 -0800 |
| commit | 45b9581fc9884da4bf60203ece1563e29aac8c96 (patch) | |
| tree | 1b7d87ee7e4afd00b5f7f721e2cbd7a843713456 /include/system | |
| parent | 8f672edfa4d46b385f8a37dc985bcc754bf01c21 (diff) | |
| download | system_core-45b9581fc9884da4bf60203ece1563e29aac8c96.zip system_core-45b9581fc9884da4bf60203ece1563e29aac8c96.tar.gz system_core-45b9581fc9884da4bf60203ece1563e29aac8c96.tar.bz2 | |
audio_is_valid_format is true for all PCM formats
Change-Id: I733f3208315816575f6d4f7722e906ab50b161af
Diffstat (limited to 'include/system')
| -rw-r--r-- | include/system/audio.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/system/audio.h b/include/system/audio.h index 35639b5..4ccf262 100644 --- a/include/system/audio.h +++ b/include/system/audio.h @@ -602,10 +602,18 @@ static inline bool audio_is_valid_format(audio_format_t format) { switch (format & AUDIO_FORMAT_MAIN_MASK) { case AUDIO_FORMAT_PCM: - if (format != AUDIO_FORMAT_PCM_16_BIT && - format != AUDIO_FORMAT_PCM_8_BIT && format != AUDIO_FORMAT_PCM_FLOAT) { + switch (format) { + case AUDIO_FORMAT_PCM_16_BIT: + case AUDIO_FORMAT_PCM_8_BIT: + case AUDIO_FORMAT_PCM_32_BIT: + case AUDIO_FORMAT_PCM_8_24_BIT: + case AUDIO_FORMAT_PCM_FLOAT: + case AUDIO_FORMAT_PCM_24_BIT_PACKED: + return true; + default: return false; } + /* not reached */ case AUDIO_FORMAT_MP3: case AUDIO_FORMAT_AMR_NB: case AUDIO_FORMAT_AMR_WB: |
