X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=wmadec_filter.c;h=8061f9aeedb32d6cd0b0cf2083eefd991ed8a1d8;hp=71a7cd785c60852ba64cb3ec1bd0395071873f67;hb=HEAD;hpb=16ff6fd77666627512e5784fe589c55f46812ad4 diff --git a/wmadec_filter.c b/wmadec_filter.c index 71a7cd78..f2ca273c 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -5,8 +5,7 @@ * * Copyright (c) 2002 The FFmpeg Project * - * Licensed under the GNU Lesser General Public License. - * For licencing details see COPYING.LIB. + * Licensed under the GNU Lesser General Public License, see file COPYING.LIB. */ /** \file wmadec_filter.c paraslash's WMA decoder. */ @@ -15,11 +14,8 @@ * This decoder handles Microsoft Windows Media Audio data version 2. */ -#define _XOPEN_SOURCE 600 - #include #include -#include #include "para.h" #include "error.h" @@ -163,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] = para_malloc(n * sizeof(uint16_t)); - pwd->level_table[didx] = para_malloc(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; @@ -431,7 +427,7 @@ static int wma_decode_init(char *initial_buf, int len, struct private_wmadec_dat int ret, i; PARA_NOTICE_LOG("initial buf: %d bytes\n", len); - pwd = para_calloc(sizeof(*pwd)); + pwd = zalloc(sizeof(*pwd)); ret = read_asf_header(initial_buf, len, &pwd->ahi); if (ret <= 0) { free(pwd); @@ -1162,7 +1158,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; @@ -1180,7 +1176,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) { @@ -1200,7 +1196,7 @@ next_buffer: if (fn->min_iqs > len) goto success; out_size = WMA_OUTPUT_BUFFER_SIZE; - out = para_malloc(out_size); + out = alloc(out_size); ret = wma_decode_superframe(pwd, out, &out_size, (uint8_t *)in + WMA_FRAME_SKIP); if (ret < 0) { @@ -1232,6 +1228,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, };