From: Peter Meerwald <[email protected]>

nsamples should be forced to be a multiple of channels; do so correctly
and don't make nsamples larger than it actually is

Signed-off-by: Peter Meerwald <[email protected]>
---
 src/tests/cpu-test.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tests/cpu-test.c b/src/tests/cpu-test.c
index 29e4770..f312edb 100644
--- a/src/tests/cpu-test.c
+++ b/src/tests/cpu-test.c
@@ -84,8 +84,8 @@ static void run_volume_test(pa_do_volume_func_t func, 
pa_do_volume_func_t orig_f
     samples_orig = s_orig + (8 - align);
     nsamples = SAMPLES - (8 - align);
     if (nsamples % channels)
-        nsamples += nsamples % channels;
-    size = nsamples * sizeof(*samples);
+        nsamples -= nsamples % channels;
+    size = nsamples * sizeof(int16_t);
 
     pa_random(samples, size);
     memcpy(samples_ref, samples, size);
-- 
1.7.9.5

_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to