1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

fftools/ffprobe: inline opt_output_file() into its only caller

There is no reason to keep them separate.

Also, replace exit_program() with returning an error code.
This commit is contained in:
Anton Khirnov
2023-07-14 18:30:23 +02:00
parent 411e183360
commit be49c48282

View File

@@ -3795,22 +3795,18 @@ static int opt_input_file_i(void *optctx, const char *opt, const char *arg)
return 0; return 0;
} }
static void opt_output_file(void *optctx, const char *arg) static int opt_output_file_o(void *optctx, const char *opt, const char *arg)
{ {
if (output_filename) { if (output_filename) {
av_log(NULL, AV_LOG_ERROR, av_log(NULL, AV_LOG_ERROR,
"Argument '%s' provided as output filename, but '%s' was already specified.\n", "Argument '%s' provided as output filename, but '%s' was already specified.\n",
arg, output_filename); arg, output_filename);
exit_program(1); return AVERROR(EINVAL);
} }
if (!strcmp(arg, "-")) if (!strcmp(arg, "-"))
arg = "fd:"; arg = "fd:";
output_filename = arg; output_filename = arg;
}
static int opt_output_file_o(void *optctx, const char *opt, const char *arg)
{
opt_output_file(optctx, arg);
return 0; return 0;
} }