projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
oggdec filter improvements.
[paraslash.git]
/
amp_filter.c
diff --git
a/amp_filter.c
b/amp_filter.c
index 750205ba69ea5ae747aa37290d57503005b0d49f..a011c411ef376c61f89fa6cc6baf574f04caeb0f 100644
(file)
--- a/
amp_filter.c
+++ b/
amp_filter.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 200
8
Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 200
9
Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
@@
-10,6
+10,7
@@
#include "amp_filter.cmdline.h"
#include "list.h"
#include "sched.h"
#include "amp_filter.cmdline.h"
#include "list.h"
#include "sched.h"
+#include "ggo.h"
#include "filter.h"
#include "string.h"
#include "error.h"
#include "filter.h"
#include "string.h"
#include "error.h"
@@
-50,20
+51,23
@@
static void amp_close(struct filter_node *fn)
free(fn->buf);
}
free(fn->buf);
}
-static
void *amp_parse_config(int argc, char **argv
)
+static
int amp_parse_config(int argc, char **argv, void **config
)
{
{
- struct amp_filter_args_info *conf = para_calloc(sizeof(*conf));
+ struct amp_filter_args_info *amp_conf = para_calloc(sizeof(*amp_conf));
+ int ret = -E_AMP_SYNTAX;
- if (amp_cmdline_parser(argc, argv, conf))
+ if (amp_cmdline_parser(argc, argv,
amp_
conf))
goto err;
goto err;
- if (conf->amp_arg < 0)
+ ret = -ERRNO_TO_PARA_ERROR(EINVAL);
+ if (amp_conf->amp_arg < 0)
goto err;
goto err;
- PARA_NOTICE_LOG("amplification: %u (scaling factor: %1.2f)\n", conf->amp_arg,
- conf->amp_arg / 64.0 + 1.0);
- return conf;
+ PARA_NOTICE_LOG("amplification: %u (scaling factor: %1.2f)\n",
+ amp_conf->amp_arg, amp_conf->amp_arg / 64.0 + 1.0);
+ *config = amp_conf;
+ return 1;
err:
err:
- free(conf);
- return
NULL
;
+ free(
amp_
conf);
+ return
ret
;
}
static void amp_open(struct filter_node *fn)
}
static void amp_open(struct filter_node *fn)
@@
-87,11
+91,17
@@
static void amp_open(struct filter_node *fn)
*
* \param f Pointer to the struct to initialize.
*/
*
* \param f Pointer to the struct to initialize.
*/
-void amp_init(struct filter *f)
+void amp_
filter_
init(struct filter *f)
{
{
+ struct amp_filter_args_info dummy;
+
+ amp_cmdline_parser_init(&dummy);
f->open = amp_open;
f->close = amp_close;
f->convert = amp_convert;
f->open = amp_open;
f->close = amp_close;
f->convert = amp_convert;
- f->print_help = amp_cmdline_parser_print_help;
f->parse_config = amp_parse_config;
f->parse_config = amp_parse_config;
+ f->help = (struct ggo_help) {
+ .short_help = amp_filter_args_info_help,
+ .detailed_help = amp_filter_args_info_detailed_help
+ };
}
}