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>
This commit is contained in:
Peter Meerwald 2014-04-16 11:25:58 +02:00 committed by Peter Meerwald
parent 937b4175c2
commit 9362bdc8a1
6 changed files with 32 additions and 41 deletions

View file

@ -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;