aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_mix.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-10 17:11:34 +0100
committerMax Kellermann <max@duempel.org>2009-12-02 22:29:50 +0100
commitc412d6251e9cd3abe735b7622af4003502e54f72 (patch)
tree7344c13f62e4cc788c830c05d21bb7b5b47f5866 /src/pcm_mix.c
parent68c2cfbb4067b2292e1ff1d4e7716ff370903f84 (diff)
downloadmpd-c412d6251e9cd3abe735b7622af4003502e54f72.tar.gz
mpd-c412d6251e9cd3abe735b7622af4003502e54f72.tar.xz
mpd-c412d6251e9cd3abe735b7622af4003502e54f72.zip
audio_format: changed "bits" to "enum sample_format"
This patch prepares support for floating point samples (and probably other formats). It changes the meaning of the "bits" attribute from a bit count to a symbolic value.
Diffstat (limited to '')
-rw-r--r--src/pcm_mix.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pcm_mix.c b/src/pcm_mix.c
index 6e678a912..0f767a1d9 100644
--- a/src/pcm_mix.c
+++ b/src/pcm_mix.c
@@ -103,18 +103,18 @@ pcm_add(void *buffer1, const void *buffer2, size_t size,
int vol1, int vol2,
const struct audio_format *format)
{
- switch (format->bits) {
- case 8:
+ switch (format->format) {
+ case SAMPLE_FORMAT_S8:
pcm_add_8((int8_t *)buffer1, (const int8_t *)buffer2,
size, vol1, vol2);
break;
- case 16:
+ case SAMPLE_FORMAT_S16:
pcm_add_16((int16_t *)buffer1, (const int16_t *)buffer2,
size / 2, vol1, vol2);
break;
- case 24:
+ case SAMPLE_FORMAT_S24_P32:
pcm_add_24((int32_t*)buffer1,
(const int32_t*)buffer2,
size / 4, vol1, vol2);
@@ -127,7 +127,8 @@ pcm_add(void *buffer1, const void *buffer2, size_t size,
break;
default:
- g_error("%u bits not supported by pcm_add!\n", format->bits);
+ g_error("format %s not supported by pcm_add",
+ sample_format_to_string(format->format));
}
}