OSDN Git Service

avconv: move audio_sample_fmt to options context.
[coroid/libav_saccubus.git] / avprobe.c
index d502421..5e83916 100644 (file)
--- 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) {
@@ -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);
 }
 
@@ -399,10 +405,8 @@ int main(int argc, char **argv)
     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 +417,5 @@ int main(int argc, char **argv)
 
     ret = probe_file(input_filename);
 
-    av_free(avformat_opts);
-
     return ret;
 }