X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=wmadec_filter.c;h=edf50cb0b3834d8971fe9602f6528e2f2bd86e5d;hb=refs%2Fheads%2Fpu;hp=1f308785fc9e026f53f72280a6066945b0748b78;hpb=26a032fffa6c6e6f092ed3d14c2b5f08e5c736d6;p=paraslash.git diff --git a/wmadec_filter.c b/wmadec_filter.c index 1f308785..5b3d9874 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -16,7 +16,6 @@ #include #include -#include #include "para.h" #include "error.h" @@ -160,8 +159,8 @@ static void init_coef_vlc(struct private_wmadec_data *pwd, int sidx, int didx) int i, l, j, k, level, n = src->n; init_vlc(dst, VLCBITS, n, src->huffbits, src->huffcodes, 4); - pwd->run_table[didx] = alloc(n * sizeof(uint16_t)); - pwd->level_table[didx] = alloc(n * sizeof(uint16_t)); + pwd->run_table[didx] = arr_alloc(n, sizeof(uint16_t)); + pwd->level_table[didx] = arr_alloc(n, sizeof(uint16_t)); i = 2; level = 1; k = 0; @@ -1148,7 +1147,8 @@ static void wmadec_close(struct filter_node *fn) fn->private_data = NULL; } -static int wmadec_execute(struct btr_node *btrn, const char *cmd, char **result) +static int wmadec_execute(const struct btr_node *btrn, const char *cmd, + char **result) { struct filter_node *fn = btr_context(btrn); struct private_wmadec_data *pwd = fn->private_data; @@ -1159,7 +1159,7 @@ static int wmadec_execute(struct btr_node *btrn, const char *cmd, char **result) #define WMA_OUTPUT_BUFFER_SIZE (128 * 1024) -static int wmadec_post_select(__a_unused struct sched *s, void *context) +static int wmadec_post_monitor(__a_unused struct sched *s, void *context) { struct filter_node *fn = context; int ret, converted, out_size; @@ -1177,7 +1177,7 @@ next_buffer: return 0; btr_merge(btrn, fn->min_iqs); len = btr_next_buffer(btrn, &in); - ret = -E_WMADEC_EOF; + ret = -E_EOF; if (len < fn->min_iqs) goto err; if (!pwd) { @@ -1229,6 +1229,6 @@ const struct filter lsg_filter_cmd_com_wmadec_user_data = { .open = wmadec_open, .close = wmadec_close, .execute = wmadec_execute, - .pre_select = generic_filter_pre_select, - .post_select = wmadec_post_select, + .pre_monitor = generic_filter_pre_monitor, + .post_monitor = wmadec_post_monitor, };