diff options
author | Maarten Bosmans <mkbosmans@gmail.com> | 2011-10-12 07:35:14 +0200 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-10-12 11:13:43 +0530 |
commit | 6bf048995f2ddcc48aa16e42874f55ce7d50b2c5 (patch) | |
tree | 0a3ddc9d9ab95cd47a42d94aef316b269a511560 | |
parent | 7b13a79959205c8c16c863c8ee31069a1f41602c (diff) |
tests: Fix calculation of memblock size in resampler-test
And remove useless volume scaling.
-rw-r--r-- | src/tests/resampler-test.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/tests/resampler-test.c b/src/tests/resampler-test.c index 545c0e08..12d06d27 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); } |