aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten2014-02-03 17:44:28 -0600
committerAndroid (Google) Code Review2014-02-03 17:44:29 -0600
commitf6dfa00304becb357b0e79569903cb3a85a62e77 (patch)
tree852f3e844fe9a89b49eafc333fd711cbe19b84a6
parent74be60166a376f5bb3326e267ad3c8227d103e9c (diff)
parentd9837d0234c2b99267738607d7ca6100ba83bcc6 (diff)
downloadplatform-external-tinyalsa-f6dfa00304becb357b0e79569903cb3a85a62e77.tar.gz
platform-external-tinyalsa-f6dfa00304becb357b0e79569903cb3a85a62e77.tar.xz
platform-external-tinyalsa-f6dfa00304becb357b0e79569903cb3a85a62e77.zip
Merge "Add support for 24-bit packed in 3 bytes"
-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;