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

@ -36,7 +36,7 @@
static void remap_mono_to_stereo_c(pa_remap_t *m, void *dst, const void *src, unsigned n) {
unsigned i;
switch (*m->format) {
switch (m->format) {
case PA_SAMPLE_FLOAT32NE:
{
float *d, *s;
@ -90,10 +90,10 @@ static void remap_channels_matrix_c(pa_remap_t *m, void *dst, const void *src, u
unsigned oc, ic, i;
unsigned n_ic, n_oc;
n_ic = m->i_ss->channels;
n_oc = m->o_ss->channels;
n_ic = m->i_ss.channels;
n_oc = m->o_ss.channels;
switch (*m->format) {
switch (m->format) {
case PA_SAMPLE_FLOAT32NE:
{
float *d, *s;
@ -164,8 +164,8 @@ static void remap_channels_matrix_c(pa_remap_t *m, void *dst, const void *src, u
static void init_remap_c(pa_remap_t *m) {
unsigned n_oc, n_ic;
n_oc = m->o_ss->channels;
n_ic = m->i_ss->channels;
n_oc = m->o_ss.channels;
n_ic = m->i_ss.channels;
/* find some common channel remappings, fall back to full matrix operation. */
if (n_ic == 1 && n_oc == 2 &&