]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: linear, route: handle linear formats with 20-bit sample on 4 bytes
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Thu, 14 Dec 2017 13:53:41 +0000 (14:53 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 18 Dec 2017 14:41:08 +0000 (15:41 +0100)
commit0c081ebbed2b240bfdb49548d4d7db8b1d7f75d5
tree6707e35be578953f5b6ee3f1f197670b04987beb
parentd67e42c139efe4965c2702ed791a77bfcccd2337
pcm: linear, route: handle linear formats with 20-bit sample on 4 bytes

The previous patch has added 20-bit PCM formats SND_PCM_FORMAT_{S,U}20 to
alsa-lib.
We need to extend the linear format conversion code with handling of these
sample formats so they can also be utilized by applications that only
recognize the more typical ones like SND_PCM_FORMAT_S16.

Since the conversion arrays are indexed by a format bit width divided by 8
the easiest way to handle these formats is to treat them like they were
40-bit wide (the next free integer multiple of 8 bits).
This doesn't create a collision risk with a future format since there can't
really be a 40-bit sample format that occupies 4 bytes.

Make sure we use the getput conversion method for these formats since a
direct conversion from / to them is not supported.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_linear.c
src/pcm/pcm_route.c
src/pcm/plugin_ops.h