diff options
author | David Henningsson <david.henningsson@canonical.com> | 2010-10-08 18:47:00 +0200 |
---|---|---|
committer | Colin Guthrie <cguthrie@mandriva.org> | 2010-10-13 14:52:13 +0100 |
commit | a8d76e99ff0b13f424b44433fb169df6735a5842 (patch) | |
tree | 9ac7970c796cddab4483dd5d023051e2eb57925c /src/pulsecore/svolume_arm.c | |
parent | a378c02ebbbaac1177474630d0b9ab083189056e (diff) |
SSE/MMX/ARM: Fix high frequency noise with unusual number of channels
In the assembly optimized versions of SSE, a noise could occur when the
number of channels were 3,5,6 or 7. For MMX and ARM, this could occur
when the number of channels were 3.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Diffstat (limited to 'src/pulsecore/svolume_arm.c')
-rw-r--r-- | src/pulsecore/svolume_arm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pulsecore/svolume_arm.c b/src/pulsecore/svolume_arm.c index 5bd1448f..fdd8f09a 100644 --- a/src/pulsecore/svolume_arm.c +++ b/src/pulsecore/svolume_arm.c @@ -47,7 +47,10 @@ pa_volume_s16ne_arm (int16_t *samples, int32_t *volumes, unsigned channels, unsi { int32_t *ve; - channels = PA_MAX (4U, channels); + /* Channels must be at least 4, and always a multiple of the original number. + * This is also the max amount we overread the volume array, which should + * have enough padding. */ + channels = channels == 3 ? 6 : PA_MAX (4U, channels); ve = volumes + channels; __asm__ __volatile__ ( |