diff options
author | Max Kellermann <max@duempel.org> | 2010-01-16 18:35:10 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-01-17 00:43:24 +0100 |
commit | 26841b6058a4368821b1ba53cc10757f90ea8a7c (patch) | |
tree | b67aa763ec16ec468e00f97d554326b7d9b70193 /src/output | |
parent | 1abfcc56af7de73c2088d7971f744778b5842ed8 (diff) | |
download | mpd-26841b6058a4368821b1ba53cc10757f90ea8a7c.tar.gz mpd-26841b6058a4368821b1ba53cc10757f90ea8a7c.tar.xz mpd-26841b6058a4368821b1ba53cc10757f90ea8a7c.zip |
output/alsa: support packed 24 bit samples
Diffstat (limited to '')
-rw-r--r-- | src/output/alsa_plugin.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/output/alsa_plugin.c b/src/output/alsa_plugin.c index e157609db..8c36e32bd 100644 --- a/src/output/alsa_plugin.c +++ b/src/output/alsa_plugin.c @@ -195,6 +195,11 @@ get_bitformat(enum sample_format sample_format) case SAMPLE_FORMAT_S24_P32: return SND_PCM_FORMAT_S24; + case SAMPLE_FORMAT_S24: + return G_BYTE_ORDER == G_BIG_ENDIAN + ? SND_PCM_FORMAT_S24_3BE + : SND_PCM_FORMAT_S24_3LE; + case SAMPLE_FORMAT_S32: return SND_PCM_FORMAT_S32; @@ -212,6 +217,13 @@ byteswap_bitformat(snd_pcm_format_t fmt) case SND_PCM_FORMAT_S32_LE: return SND_PCM_FORMAT_S32_BE; case SND_PCM_FORMAT_S16_BE: return SND_PCM_FORMAT_S16_LE; case SND_PCM_FORMAT_S24_BE: return SND_PCM_FORMAT_S24_LE; + + case SND_PCM_FORMAT_S24_3BE: + return SND_PCM_FORMAT_S24_3LE; + + case SND_PCM_FORMAT_S24_3LE: + return SND_PCM_FORMAT_S24_3BE; + case SND_PCM_FORMAT_S32_BE: return SND_PCM_FORMAT_S32_LE; default: return SND_PCM_FORMAT_UNKNOWN; } @@ -296,6 +308,7 @@ alsa_output_setup_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams, static const enum sample_format probe_formats[] = { SAMPLE_FORMAT_S24_P32, SAMPLE_FORMAT_S32, + SAMPLE_FORMAT_S24, SAMPLE_FORMAT_S16, SAMPLE_FORMAT_S8, SAMPLE_FORMAT_UNDEFINED, |