]> git.sesse.net Git - ffmpeg/blobdiff - avprobe.c
avconv: split printing "main options" into global and per-file.
[ffmpeg] / avprobe.c
index 5fe5b890c319726c2dbbdd6bdf9dc934c648f1f7..00e0ad09e0659b65c871228bc0bc4425ed3117e7 100644 (file)
--- a/avprobe.c
+++ b/avprobe.c
@@ -26,6 +26,7 @@
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/dict.h"
+#include "libavutil/libm.h"
 #include "libavdevice/avdevice.h"
 #include "cmdutils.h"
 
@@ -468,7 +469,7 @@ static char *value_string(char *buf, int buf_size, double val, const char *unit)
         int index;
 
         if (unit == unit_byte_str && use_byte_value_binary_prefix) {
-            index = (int) (log(val)/log(2)) / 10;
+            index = (int) log2(val) / 10;
             index = av_clip(index, 0, FF_ARRAY_ELEMS(binary_unit_prefixes) - 1);
             val  /= pow(2, index * 10);
             prefix_string = binary_unit_prefixes[index];
@@ -580,7 +581,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
 {
     AVStream *stream = fmt_ctx->streams[stream_idx];
     AVCodecContext *dec_ctx;
-    AVCodec *dec;
+    const AVCodec *dec;
     const char *profile;
     char val_str[128];
     AVRational display_aspect_ratio;
@@ -730,7 +731,7 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
         AVStream *stream = fmt_ctx->streams[i];
         AVCodec *codec;
 
-        if (stream->codec->codec_id == CODEC_ID_PROBE) {
+        if (stream->codec->codec_id == AV_CODEC_ID_PROBE) {
             fprintf(stderr, "Failed to probe codec for input stream %d\n",
                     stream->index);
         } else if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
@@ -867,11 +868,11 @@ static void opt_input_file(void *optctx, const char *arg)
     input_filename = arg;
 }
 
-static void show_help(void)
+void show_help_default(const char *opt, const char *arg)
 {
     av_log_set_callback(log_callback_help);
     show_usage();
-    show_help_options(options, "Main options:\n", 0, 0);
+    show_help_options(options, "Main options:", 0, 0, 0);
     printf("\n");
     show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
 }