aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten2014-01-31 09:56:33 -0600
committerGlenn Kasten2014-01-31 10:09:28 -0600
commitd9837d0234c2b99267738607d7ca6100ba83bcc6 (patch)
treec78624b522fc43e1016cba1aa02bf3d6fb0bc246
parentc98da79067d89d934c4eb7de6a03e412eb421a5c (diff)
downloadplatform-external-tinyalsa-d9837d0234c2b99267738607d7ca6100ba83bcc6.tar.gz
platform-external-tinyalsa-d9837d0234c2b99267738607d7ca6100ba83bcc6.tar.xz
platform-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 {
74 PCM_FORMAT_S32_LE, 74 PCM_FORMAT_S32_LE,
75 PCM_FORMAT_S8, 75 PCM_FORMAT_S8,
76 PCM_FORMAT_S24_LE, 76 PCM_FORMAT_S24_LE,
77 PCM_FORMAT_S24_3LE,
77 78
78 PCM_FORMAT_MAX, 79 PCM_FORMAT_MAX,
79}; 80};
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)
205 return SNDRV_PCM_FORMAT_S32_LE; 205 return SNDRV_PCM_FORMAT_S32_LE;
206 case PCM_FORMAT_S8: 206 case PCM_FORMAT_S8:
207 return SNDRV_PCM_FORMAT_S8; 207 return SNDRV_PCM_FORMAT_S8;
208 case PCM_FORMAT_S24_3LE:
209 return SNDRV_PCM_FORMAT_S24_3LE;
208 case PCM_FORMAT_S24_LE: 210 case PCM_FORMAT_S24_LE:
209 return SNDRV_PCM_FORMAT_S24_LE; 211 return SNDRV_PCM_FORMAT_S24_LE;
210 default: 212 default:
@@ -219,6 +221,8 @@ unsigned int pcm_format_to_bits(enum pcm_format format)
219 case PCM_FORMAT_S32_LE: 221 case PCM_FORMAT_S32_LE:
220 case PCM_FORMAT_S24_LE: 222 case PCM_FORMAT_S24_LE:
221 return 32; 223 return 32;
224 case PCM_FORMAT_S24_3LE:
225 return 24;
222 default: 226 default:
223 case PCM_FORMAT_S16_LE: 227 case PCM_FORMAT_S16_LE:
224 return 16; 228 return 16;