X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=oggdec.c;fp=oggdec.c;h=46fb17ed5808e1c425ad6e9b2da178474f815d4a;hb=b779fcfc62bca2e728348c70bab3c50df3fe63b8;hp=e22ea1e464fa083c108c1474c37c802fa6b64659;hpb=5c575441c5ac69d3107d8032c1c1d2d7f5c72ee1;p=paraslash.git diff --git a/oggdec.c b/oggdec.c index e22ea1e4..46fb17ed 100644 --- a/oggdec.c +++ b/oggdec.c @@ -163,15 +163,16 @@ static ssize_t ogg_convert(char *inbuffer, size_t len, struct filter_node *fn) 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) @@ -180,10 +181,11 @@ static void *oggdec_parse_config(int argc, char **argv) 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; } /**