summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
877ad8d)
State can be used by remap function implementations to
speed up the remapping, e.g. by precomputing things or
even by generating specialized code for a specific channel
remapping task
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
float map_table_f[PA_CHANNELS_MAX][PA_CHANNELS_MAX];
int32_t map_table_i[PA_CHANNELS_MAX][PA_CHANNELS_MAX];
pa_do_remap_func_t do_remap;
float map_table_f[PA_CHANNELS_MAX][PA_CHANNELS_MAX];
int32_t map_table_i[PA_CHANNELS_MAX][PA_CHANNELS_MAX];
pa_do_remap_func_t do_remap;
+ void *state; /* optional state information for the remap function */
};
void pa_init_remap_func(pa_remap_t *m);
};
void pa_init_remap_func(pa_remap_t *m);
#endif
static void setup_remap(const pa_resampler *r, pa_remap_t *m);
#endif
static void setup_remap(const pa_resampler *r, pa_remap_t *m);
+static void free_remap(pa_remap_t *m);
static int (* const init_table[])(pa_resampler*r) = {
#ifdef HAVE_LIBSAMPLERATE
static int (* const init_table[])(pa_resampler*r) = {
#ifdef HAVE_LIBSAMPLERATE
if (r->from_work_format_buf.memblock)
pa_memblock_unref(r->from_work_format_buf.memblock);
if (r->from_work_format_buf.memblock)
pa_memblock_unref(r->from_work_format_buf.memblock);
+ free_remap(&r->remap);
+
+static void free_remap(pa_remap_t *m) {
+ pa_assert(m);
+
+ pa_xfree(m->state);
+}
+
/* check if buf's memblock is large enough to hold 'len' bytes; create a
* new memblock if necessary and optionally preserve 'copy' data bytes */
static void fit_buf(pa_resampler *r, pa_memchunk *buf, size_t len, size_t *size, size_t copy) {
/* check if buf's memblock is large enough to hold 'len' bytes; create a
* new memblock if necessary and optionally preserve 'copy' data bytes */
static void fit_buf(pa_resampler *r, pa_memchunk *buf, size_t len, size_t *size, size_t copy) {