From 5e3f9979fae32fe837dab6cff5bde7de3c387611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Wed, 5 Sep 2012 07:03:56 +0000 Subject: Use atexit() instead of defining a custom exit_program() interface. --- cmdutils.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cmdutils.c') diff --git a/cmdutils.c b/cmdutils.c index 0d216db469..9dbff9e846 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -97,7 +97,7 @@ double parse_number_or_die(const char *context, const char *numstr, int type, else return d; av_log(NULL, AV_LOG_FATAL, error, context, numstr, min, max); - exit_program(1); + exit(1); return 0; } @@ -108,7 +108,7 @@ int64_t parse_time_or_die(const char *context, const char *timestr, if (av_parse_time(&us, timestr, is_duration) < 0) { av_log(NULL, AV_LOG_FATAL, "Invalid %s specification for %s: %s\n", is_duration ? "duration" : "date", context, timestr); - exit_program(1); + exit(1); } return us; } @@ -294,7 +294,7 @@ int parse_option(void *optctx, const char *opt, const char *arg, } } if (po->flags & OPT_EXIT) - exit_program(0); + exit(0); return !!(po->flags & HAS_ARG); } @@ -320,7 +320,7 @@ void parse_options(void *optctx, int argc, char **argv, const OptionDef *options opt++; if ((ret = parse_option(optctx, opt, argv[optindex], options)) < 0) - exit_program(1); + exit(1); optindex += ret; } else { if (parse_arg_function) @@ -429,7 +429,7 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg) "Possible levels are numbers or:\n", arg); for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) av_log(NULL, AV_LOG_FATAL, "\"%s\"\n", log_levels[i].name); - exit_program(1); + exit(1); } av_log_set_level(level); return 0; @@ -1265,13 +1265,13 @@ void *grow_array(void *array, int elem_size, int *size, int new_size) { if (new_size >= INT_MAX / elem_size) { av_log(NULL, AV_LOG_ERROR, "Array too big.\n"); - exit_program(1); + exit(1); } if (*size < new_size) { uint8_t *tmp = av_realloc(array, new_size*elem_size); if (!tmp) { av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n"); - exit_program(1); + exit(1); } memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); *size = new_size; -- cgit v1.2.3