/*
- * Copyright (C) 2005-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2012 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
#include <mad.h>
#include <regex.h>
-#include <stdbool.h>
#include "para.h"
#include "mp3dec_filter.cmdline.h"
ret = handle_decode_error(pmd);
if (ret < 0)
goto err;
- ret = mad_stream_sync(&pmd->stream);
+ mad_stream_sync(&pmd->stream);
if (pmd->stream.error == MAD_ERROR_BUFLEN) {
ret = -E_MP3DEC_EOF;
if (len == iqs && btr_no_parent(btrn))
err:
assert(ret < 0);
t->error = ret;
- btr_remove_node(btrn);
+ btr_remove_node(&fn->btrn);
}
static void mp3dec_open(struct filter_node *fn)
static int mp3dec_parse_config(int argc, char **argv, void **config)
{
- int ret;
- struct mp3dec_filter_args_info *mp3_conf;
+ struct mp3dec_filter_args_info *conf = para_calloc(sizeof(*conf));
- mp3_conf = para_calloc(sizeof(*mp3_conf));
- ret = -E_MP3DEC_SYNTAX;
- if (mp3dec_cmdline_parser(argc, argv, mp3_conf))
- goto err;
- *config = mp3_conf;
+ mp3dec_filter_cmdline_parser(argc, argv, conf);
+ *config = conf;
return 1;
-err:
- free(mp3_conf);
- return ret;
}
static int mp3dec_execute(struct btr_node *btrn, const char *cmd, char **result)
static void mp3dec_free_config(void *conf)
{
- mp3dec_cmdline_parser_free(conf);
+ mp3dec_filter_cmdline_parser_free(conf);
}
/**
* The init function of the mp3dec filter.
{
struct mp3dec_filter_args_info dummy;
- mp3dec_cmdline_parser_init(&dummy);
+ mp3dec_filter_cmdline_parser_init(&dummy);
f->open = mp3dec_open;
f->close = mp3dec_close;
f->parse_config = mp3dec_parse_config;