From c412d6251e9cd3abe735b7622af4003502e54f72 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Nov 2009 17:11:34 +0100 Subject: 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. --- src/pcm_mix.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/pcm_mix.c') 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)); } } -- cgit v1.2.3