alsa/alsa-lib-dmix-add-s24-le-support.diff

81 lines
2.9 KiB
Diff

From 7fd0d9f42357e49bc28259421de6338122381cb2 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 2 Mar 2010 14:01:32 +0100
Subject: [PATCH] pcm_dmix: add support for S24_LE format
From: Bart De Vos <bart_dv@eia.be>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_direct.c | 1 +
src/pcm/pcm_dmix.c | 8 ++++++++
src/pcm/pcm_dmix_generic.c | 2 +-
src/pcm/pcm_dmix_i386.c | 1 +
4 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index d9e596e..b648f3a 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -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,
};
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index 90470e0..3b791c1 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -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;
diff --git a/src/pcm/pcm_dmix_generic.c b/src/pcm/pcm_dmix_generic.c
index a1086c9..9e9d3c3 100644
--- a/src/pcm/pcm_dmix_generic.c
+++ b/src/pcm/pcm_dmix_generic.c
@@ -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>
diff --git a/src/pcm/pcm_dmix_i386.c b/src/pcm/pcm_dmix_i386.c
index 68c4755..dcc6b9a 100644
--- a/src/pcm/pcm_dmix_i386.c
+++ b/src/pcm/pcm_dmix_i386.c
@@ -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 \
--
1.7.0.1