diff options
Diffstat (limited to 'src/pulsecore/svolume_mmx.c')
-rw-r--r-- | src/pulsecore/svolume_mmx.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c index e50ebee8..a71a39ba 100644 --- a/src/pulsecore/svolume_mmx.c +++ b/src/pulsecore/svolume_mmx.c @@ -98,9 +98,10 @@ pa_volume_s16ne_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi { pa_reg_x86 channel, temp; - /* the max number of samples we process at a time, this is also the max amount - * we overread the volume array, which should have enough padding. */ - 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); __asm__ __volatile__ ( " xor %3, %3 \n\t" @@ -164,9 +165,10 @@ pa_volume_s16re_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi { pa_reg_x86 channel, temp; - /* the max number of samples we process at a time, this is also the max amount - * we overread the volume array, which should have enough padding. */ - 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); __asm__ __volatile__ ( " xor %3, %3 \n\t" |