diff options
author | Andy Hung <hunga@google.com> | 2015-05-05 23:20:25 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2015-05-06 10:13:34 -0700 |
commit | dca2ec0a335a6be68ce74baa3aca4458d48c78bb (patch) | |
tree | 7599f2e6b39232e190ad898c8505364577fe5c7c /alsa_utils | |
parent | 3f822c559a5515caaa48459d0d5772ad1779bdb8 (diff) | |
download | android_system_media-dca2ec0a335a6be68ce74baa3aca4458d48c78bb.tar.gz android_system_media-dca2ec0a335a6be68ce74baa3aca4458d48c78bb.tar.bz2 android_system_media-dca2ec0a335a6be68ce74baa3aca4458d48c78bb.zip |
Add channel index mask for usb output
Change-Id: Icae9e784debd8f515bd1a4dd025d0915438bdeb4
Diffstat (limited to 'alsa_utils')
-rw-r--r-- | alsa_utils/alsa_device_profile.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/alsa_utils/alsa_device_profile.c b/alsa_utils/alsa_device_profile.c index 7f6071c7..9efbe0bb 100644 --- a/alsa_utils/alsa_device_profile.c +++ b/alsa_utils/alsa_device_profile.c @@ -528,20 +528,18 @@ char * profile_get_channel_count_strs(alsa_device_profile* profile) strlcat(buffer, "|", buffSize); curStrLen = strlcat(buffer, chans_strs[channel_count], buffSize); } - // for input allow channel index masks. - // TODO: allow for output as well? - if (!isOutProfile) { - // account for the '|' and the '\0' - if (buffSize - curStrLen < strlen(index_chans_strs[channel_count]) + 2) { - /* we don't have room for another, so bail at this point rather than - * return a malformed rate string - */ - break; - } - - strlcat(buffer, "|", buffSize); - curStrLen = strlcat(buffer, index_chans_strs[channel_count], buffSize); - } + + // handle channel index masks for both input and output + // +2 to account for the '|' and the '\0' + if (buffSize - curStrLen < strlen(index_chans_strs[channel_count]) + 2) { + /* we don't have room for another, so bail at this point rather than + * return a malformed rate string + */ + break; + } + + strlcat(buffer, "|", buffSize); + curStrLen = strlcat(buffer, index_chans_strs[channel_count], buffSize); } return strdup(buffer); |