return pod->converted;
}
-static void *oggdec_parse_config(int argc, char **argv)
+static int oggdec_parse_config(int argc, char **argv, void **config)
{
int ret;
struct oggdec_filter_args_info *ogg_conf;
ogg_conf = para_calloc(sizeof(*ogg_conf));
- ret = oggdec_cmdline_parser(argc, argv, ogg_conf);
- if (ret)
+ ret = -E_OGGDEC_SYNTAX;
+ if (oggdec_cmdline_parser(argc, argv, ogg_conf))
goto err;
+ ret = -ERRNO_TO_PARA_ERROR(EINVAL);
if (ogg_conf->bufsize_arg < 0)
goto err;
if (ogg_conf->bufsize_arg >= INT_MAX / 1024)
goto err;
if (ogg_conf->initial_buffer_arg >= INT_MAX / 1024)
goto err;
- return ogg_conf;
+ *config = ogg_conf;
+ return 1;
err:
free(ogg_conf);
- return NULL;
+ return ret;
}
/**
*
* \param f Its fields are filled in by the function.
*/
-void oggdec_init(struct filter *f)
+void oggdec_filter_init(struct filter *f)
{
f->open = ogg_open;
f->close = ogg_close;