[pulseaudio-commits] src/tests

Arun Raghavan arun at kemper.freedesktop.org
Tue Oct 11 22:43:06 PDT 2011


 src/tests/resampler-test.c |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 89f00f3e4c201ab27f4f2d7a2b67a36eea255a82
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Wed Oct 12 07:35:14 2011 +0200

    tests: Fix calculation of memblock size in resampler-test
    
    And remove useless volume scaling.

diff --git a/src/tests/resampler-test.c b/src/tests/resampler-test.c
index 545c0e0..12d06d2 100644
--- a/src/tests/resampler-test.c
+++ b/src/tests/resampler-test.c
@@ -296,7 +296,6 @@ static void dump_resample_methods(void) {
 int main(int argc, char *argv[]) {
     pa_mempool *pool = NULL;
     pa_sample_spec a, b;
-    pa_cvolume v;
     int ret = 1, verbose = 0, c;
     pa_bool_t all_formats = TRUE;
     pa_resample_method_t method;
@@ -328,8 +327,6 @@ int main(int argc, char *argv[]) {
     a.channels = b.channels = 1;
     a.rate = b.rate = 44100;
     a.format = b.format = PA_SAMPLE_S16LE;
-    v.channels = a.channels;
-    v.values[0] = pa_sw_volume_from_linear(0.5);
 
     method = PA_RESAMPLER_AUTO;
     seconds = 60;
@@ -421,7 +418,7 @@ int main(int argc, char *argv[]) {
         pa_assert_se(resampler = pa_resampler_new(pool, &a, NULL, &b, NULL, method, 0));
         printf("init: %llu\n", (long long unsigned)(pa_rtclock_now() - ts));
 
-        i.memblock = pa_memblock_new(pool, pa_usec_to_bytes(1*PA_USEC_PER_SEC, &a) / pa_frame_size(&a));
+        i.memblock = pa_memblock_new(pool, pa_usec_to_bytes(1*PA_USEC_PER_SEC, &a));
 
         ts = pa_rtclock_now();
         i.length = pa_memblock_get_length(i.memblock);
@@ -465,15 +462,10 @@ int main(int argc, char *argv[]) {
             printf("reverse: ");
             dump_block(&a, &k);
 
+            pa_memblock_unref(i.memblock);
             pa_memblock_unref(j.memblock);
             pa_memblock_unref(k.memblock);
 
-            pa_volume_memchunk(&i, &a, &v);
-            printf("volume:  ");
-            dump_block(&a, &i);
-
-            pa_memblock_unref(i.memblock);
-
             pa_resampler_free(forth);
             pa_resampler_free(back);
         }



More information about the pulseaudio-commits mailing list