pcm_dmix: add support for S24_LE format
authorJaroslav Kysela <perex@perex.cz>
Tue, 2 Mar 2010 13:01:32 +0000 (14:01 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 2 Mar 2010 13:01:32 +0000 (14:01 +0100)
From: Bart De Vos <bart_dv@eia.be>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

src/pcm/pcm_direct.c
src/pcm/pcm_dmix.c
src/pcm/pcm_dmix_generic.c
src/pcm/pcm_dmix_i386.c

index d9e596e..b648f3a 100644 (file)
@@ -888,6 +888,7 @@ int snd_pcm_direct_initialize_slave(snd_pcm_direct_t *dmix, snd_pcm_t *spcm, str
                        SND_PCM_FORMAT_S32 ^ SND_PCM_FORMAT_S32_LE ^ SND_PCM_FORMAT_S32_BE,
                        SND_PCM_FORMAT_S16,
                        SND_PCM_FORMAT_S16 ^ SND_PCM_FORMAT_S16_LE ^ SND_PCM_FORMAT_S16_BE,
+                       SND_PCM_FORMAT_S24_LE,
                        SND_PCM_FORMAT_S24_3LE,
                        SND_PCM_FORMAT_U8,
                };
index 90470e0..3b791c1 100644 (file)
@@ -174,6 +174,10 @@ static void mix_areas(snd_pcm_direct_t *dmix,
                sample_size = 4;
                do_mix_areas = (mix_areas_t *)dmix->u.dmix.mix_areas_32;
                break;
+       case SND_PCM_FORMAT_S24_LE:
+               sample_size = 4;
+               do_mix_areas = (mix_areas_t *)dmix->u.dmix.mix_areas_24;
+               break;
        case SND_PCM_FORMAT_S24_3LE:
                sample_size = 3;
                do_mix_areas = (mix_areas_t *)dmix->u.dmix.mix_areas_24;
@@ -238,6 +242,10 @@ static void remix_areas(snd_pcm_direct_t *dmix,
                sample_size = 4;
                do_remix_areas = (mix_areas_t *)dmix->u.dmix.remix_areas_32;
                break;
+       case SND_PCM_FORMAT_S24_LE:
+               sample_size = 4;
+               do_remix_areas = (mix_areas_t *)dmix->u.dmix.remix_areas_24;
+               break;
        case SND_PCM_FORMAT_S24_3LE:
                sample_size = 3;
                do_remix_areas = (mix_areas_t *)dmix->u.dmix.remix_areas_24;
index a1086c9..9e9d3c3 100644 (file)
@@ -122,7 +122,7 @@ static void mix_select_callbacks(snd_pcm_direct_t *dmix)
 #define generic_dmix_supported_format \
        ((1ULL << SND_PCM_FORMAT_S16_LE) | (1ULL << SND_PCM_FORMAT_S32_LE) |\
         (1ULL << SND_PCM_FORMAT_S16_BE) | (1ULL << SND_PCM_FORMAT_S32_BE) |\
-        (1ULL << SND_PCM_FORMAT_S24_3LE) | \
+        (1ULL << SND_PCM_FORMAT_S24_LE) | (1ULL << SND_PCM_FORMAT_S24_3LE) | \
         (1ULL << SND_PCM_FORMAT_U8))
 
 #include <byteswap.h>
index 68c4755..dcc6b9a 100644 (file)
@@ -77,6 +77,7 @@
 #define i386_dmix_supported_format \
        ((1ULL << SND_PCM_FORMAT_S16_LE) |\
         (1ULL << SND_PCM_FORMAT_S32_LE) |\
+        (1ULL << SND_PCM_FORMAT_S24_LE) |\
         (1ULL << SND_PCM_FORMAT_S24_3LE))
 
 #define dmix_supported_format \