summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-05-01 04:14:40 +0200
committerLennart Poettering <lennart@poettering.net>2009-05-01 04:14:40 +0200
commitd2b5ae5525e9036c4f91b1615879a5a07aac5bf2 (patch)
tree2ec6f67bd73eb703c2b705698a2c25998276fac2 /src
parent3a7b287c7ebd4e1b23ab076700201d0acb5a00c2 (diff)
sample-util: fix iteration loop when adjusting volume of s24 samples
Diffstat (limited to 'src')
-rw-r--r--src/pulsecore/sample-util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pulsecore/sample-util.c b/src/pulsecore/sample-util.c
index 007a2f02..dda38834 100644
--- a/src/pulsecore/sample-util.c
+++ b/src/pulsecore/sample-util.c
@@ -831,9 +831,9 @@ void pa_volume_memchunk(
calc_linear_integer_volume(linear, volume);
- e = (uint8_t*) ptr + c->length/3;
+ e = (uint8_t*) ptr + c->length;
- for (channel = 0, d = ptr; d < e; d++) {
+ for (channel = 0, d = ptr; d < e; d += 3) {
int64_t t;
t = (int64_t)((int32_t) (PA_READ24NE(d) << 8));
@@ -854,9 +854,9 @@ void pa_volume_memchunk(
calc_linear_integer_volume(linear, volume);
- e = (uint8_t*) ptr + c->length/3;
+ e = (uint8_t*) ptr + c->length;
- for (channel = 0, d = ptr; d < e; d++) {
+ for (channel = 0, d = ptr; d < e; d += 3) {
int64_t t;
t = (int64_t)((int32_t) (PA_READ24RE(d) << 8));