summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorPeter Meerwald <p.meerwald@bct-electronic.com>2014-04-16 11:25:58 +0200
committerPeter Meerwald <pmeerw@pmeerw.net>2014-04-29 00:00:06 +0200
commit9362bdc8a1d5bd1ce213c517e1999644728193a2 (patch)
tree78b081573e84c8e2db552d53861714f071305799 /src/tests
parent937b4175c2aadf4076182126c8bb2499d347a30e (diff)
remap: Make resampler's remap structure more self-contained
Initialization of the remap structure now happens in one place Rename calc_map_table() to setup_remap(), copy sample format and channel specs; the remap structure is initialized when we know the work sample format of the resampler Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/cpu-test.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/tests/cpu-test.c b/src/tests/cpu-test.c
index c57a375d8..96137c797 100644
--- a/src/tests/cpu-test.c
+++ b/src/tests/cpu-test.c
@@ -549,17 +549,12 @@ static void remap_test_mono_stereo_float(
pa_init_remap_func_t init_func,
pa_init_remap_func_t orig_init_func) {
- pa_sample_format_t sf;
pa_remap_t remap;
- pa_sample_spec iss, oss;
pa_do_remap_func_t orig_func, func;
- iss.format = oss.format = sf = PA_SAMPLE_FLOAT32NE;
- iss.channels = 1;
- oss.channels = 2;
- remap.format = &sf;
- remap.i_ss = &iss;
- remap.o_ss = &oss;
+ remap.format = PA_SAMPLE_FLOAT32NE;
+ remap.i_ss.channels = 1;
+ remap.o_ss.channels = 2;
remap.map_table_f[0][0] = 1.0;
remap.map_table_f[1][0] = 1.0;
remap.map_table_i[0][0] = 0x10000;
@@ -588,17 +583,12 @@ static void remap_test_mono_stereo_s16(
pa_init_remap_func_t init_func,
pa_init_remap_func_t orig_init_func) {
- pa_sample_format_t sf;
pa_remap_t remap;
- pa_sample_spec iss, oss;
pa_do_remap_func_t orig_func, func;
- iss.format = oss.format = sf = PA_SAMPLE_S16NE;
- iss.channels = 1;
- oss.channels = 2;
- remap.format = &sf;
- remap.i_ss = &iss;
- remap.o_ss = &oss;
+ remap.format = PA_SAMPLE_S16NE;
+ remap.i_ss.channels = 1;
+ remap.o_ss.channels = 2;
remap.map_table_f[0][0] = 1.0;
remap.map_table_f[1][0] = 1.0;
remap.map_table_i[0][0] = 0x10000;