X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=avprobe.c;h=ae22dac6487c6d25abc2bf279af19ccf7cf8f662;hb=3db8db406ff213bf177cc23c44f6cbc8778b1bea;hp=3843af9b728b0f12528614c67073afe1d7271a3b;hpb=9e12f0bf5f45361a36f9d8c3abca24af55ca740c;p=ffmpeg diff --git a/avprobe.c b/avprobe.c index 3843af9b728..ae22dac6487 100644 --- a/avprobe.c +++ b/avprobe.c @@ -56,6 +56,11 @@ static const char *unit_hertz_str = "Hz" ; static const char *unit_byte_str = "byte" ; static const char *unit_bit_per_second_str = "bit/s"; +void exit_program(int ret) +{ + exit(ret); +} + static char *value_string(char *buf, int buf_size, double val, const char *unit) { if (unit == unit_second_str && use_value_sexagesimal_format) { @@ -277,7 +282,7 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename) /* fill the streams in the format context */ - if ((err = av_find_stream_info(fmt_ctx)) < 0) { + if ((err = avformat_find_stream_info(fmt_ctx, NULL)) < 0) { print_error(filename, err); return err; } @@ -341,7 +346,7 @@ static int opt_format(const char *opt, const char *arg) return 0; } -static void opt_input_file(const char *arg) +static void opt_input_file(void *optctx, const char *arg) { if (input_filename) { fprintf(stderr, "Argument '%s' provided as input filename, but '%s' was already specified.\n", @@ -355,11 +360,12 @@ static void opt_input_file(const char *arg) static void show_help(void) { + const AVClass *class = avformat_get_class(); av_log_set_callback(log_callback_help); show_usage(); show_help_options(options, "Main options:\n", 0, 0); printf("\n"); - av_opt_show2(avformat_opts, NULL, + av_opt_show2(&class, NULL, AV_OPT_FLAG_DECODING_PARAM, 0); } @@ -393,16 +399,15 @@ int main(int argc, char **argv) { int ret; + parse_loglevel(argc, argv, options); av_register_all(); init_opts(); #if CONFIG_AVDEVICE avdevice_register_all(); #endif - avformat_opts = avformat_alloc_context(); - show_banner(); - parse_options(argc, argv, options, opt_input_file); + parse_options(NULL, argc, argv, options, opt_input_file); if (!input_filename) { show_usage(); @@ -413,7 +418,5 @@ int main(int argc, char **argv) ret = probe_file(input_filename); - av_free(avformat_opts); - return ret; }