aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-01-31 07:56:33 -0800
committerGlenn Kasten <gkasten@google.com>2014-01-31 08:09:28 -0800
commitd9837d0234c2b99267738607d7ca6100ba83bcc6 (patch)
treec78624b522fc43e1016cba1aa02bf3d6fb0bc246
parentc98da79067d89d934c4eb7de6a03e412eb421a5c (diff)
downloadandroid_external_tinyalsa-d9837d0234c2b99267738607d7ca6100ba83bcc6.tar.gz
android_external_tinyalsa-d9837d0234c2b99267738607d7ca6100ba83bcc6.tar.bz2
android_external_tinyalsa-d9837d0234c2b99267738607d7ca6100ba83bcc6.zip
Add support for 24-bit packed in 3 bytes
Change-Id: Idc977bba5f364d8a22fe9756edf9bd2859eb0441
-rw-r--r--include/tinyalsa/asoundlib.h1
-rw-r--r--pcm.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h
index ec526e6..a4806fe 100644
--- a/include/tinyalsa/asoundlib.h
+++ b/include/tinyalsa/asoundlib.h
@@ -74,6 +74,7 @@ enum pcm_format {
PCM_FORMAT_S32_LE,
PCM_FORMAT_S8,
PCM_FORMAT_S24_LE,
+ PCM_FORMAT_S24_3LE,
PCM_FORMAT_MAX,
};
diff --git a/pcm.c b/pcm.c
index 4501777..2842e9e 100644
--- a/pcm.c
+++ b/pcm.c
@@ -205,6 +205,8 @@ static unsigned int pcm_format_to_alsa(enum pcm_format format)
return SNDRV_PCM_FORMAT_S32_LE;
case PCM_FORMAT_S8:
return SNDRV_PCM_FORMAT_S8;
+ case PCM_FORMAT_S24_3LE:
+ return SNDRV_PCM_FORMAT_S24_3LE;
case PCM_FORMAT_S24_LE:
return SNDRV_PCM_FORMAT_S24_LE;
default:
@@ -219,6 +221,8 @@ unsigned int pcm_format_to_bits(enum pcm_format format)
case PCM_FORMAT_S32_LE:
case PCM_FORMAT_S24_LE:
return 32;
+ case PCM_FORMAT_S24_3LE:
+ return 24;
default:
case PCM_FORMAT_S16_LE:
return 16;