X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=aacdec_filter.c;h=a2459d82b31991a8e9ac578e0559a398c83f4e10;hb=HEAD;hp=e1cf802cb0e4c807e8684957424c7237eee787e4;hpb=64411efdbd90f1080ad1fd010d468cea63aec923;p=paraslash.git diff --git a/aacdec_filter.c b/aacdec_filter.c index e1cf802c..87a7900a 100644 --- a/aacdec_filter.c +++ b/aacdec_filter.c @@ -1,8 +1,4 @@ -/* - * Copyright (C) 2006 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2006 Andre Noll , see file COPYING. */ /* * based in parts on libfaad, Copyright (C) 2003-2005 M. Bakker, * Ahead Software AG @@ -17,7 +13,6 @@ #include "portable_io.h" #include "list.h" #include "sched.h" -#include "ggo.h" #include "buffer_tree.h" #include "filter.h" #include "error.h" @@ -29,7 +24,7 @@ /** * data specific to the aacdec filter * - * \sa filter, filter_node + * \sa \ref filter, \ref filter_node. */ struct private_aacdec_data { /** the return value of aac_open */ @@ -57,7 +52,7 @@ static int aacdec_execute(struct btr_node *btrn, const char *cmd, char **result) static void aacdec_open(struct filter_node *fn) { NeAACDecConfigurationPtr c; - struct private_aacdec_data *padd = para_calloc(sizeof(*padd)); + struct private_aacdec_data *padd = zalloc(sizeof(*padd)); padd->handle = NeAACDecOpen(); c = NeAACDecGetCurrentConfiguration(padd->handle); @@ -79,7 +74,7 @@ static void aacdec_close(struct filter_node *fn) fn->private_data = NULL; } -static int aacdec_post_select(__a_unused struct sched *s, void *context) +static int aacdec_post_monitor(__a_unused struct sched *s, void *context) { struct filter_node *fn = context; struct btr_node *btrn = fn->btrn; @@ -141,7 +136,7 @@ next_buffer: consumed += frame_info.bytesconsumed; if (!frame_info.samples) goto success; - btrbuf = para_malloc(2 * frame_info.samples); + btrbuf = arr_alloc(2, frame_info.samples); for (i = 0; i < frame_info.samples; i++) { short sh = ((short *)outbuf)[i]; write_int16_host_endian(btrbuf + loaded, sh); @@ -160,18 +155,10 @@ err: return ret; } -/** - * The init function of the aacdec filter. - * - * \param f Pointer to the filter struct to initialize. - * - * \sa filter::init - */ -void aacdec_filter_init(struct filter *f) -{ - f->open = aacdec_open; - f->close = aacdec_close; - f->pre_select = generic_filter_pre_select; - f->post_select = aacdec_post_select; - f->execute = aacdec_execute; -} +const struct filter lsg_filter_cmd_com_aacdec_user_data = { + .open = aacdec_open, + .close = aacdec_close, + .pre_monitor = generic_filter_pre_monitor, + .post_monitor = aacdec_post_monitor, + .execute = aacdec_execute +};