Revision 1be784a2

View differences:

doc/ffprobe-doc.texi
65 65
@section Main options
66 66

  
67 67
@table @option
68

  
69
@item -f @var{format}
70
Force format to use.
71

  
68 72
@item -unit
69 73
Show the unit of the displayed values.
70 74

  
ffprobe.c
42 42

  
43 43
/* FFprobe context */
44 44
static const char *input_filename;
45
static AVInputFormat *iformat = NULL;
45 46

  
46 47
static const char *binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" };
47 48
static const char *decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P"  };
......
221 222

  
222 223
    fmt_ctx = avformat_alloc_context();
223 224

  
224
    if ((err = av_open_input_file(&fmt_ctx, filename, NULL, 0, NULL)) < 0) {
225
    if ((err = av_open_input_file(&fmt_ctx, filename, iformat, 0, NULL)) < 0) {
225 226
        print_error(filename, err);
226 227
        return err;
227 228
    }
......
278 279
    printf("\n");
279 280
}
280 281

  
282
static void opt_format(const char *arg)
283
{
284
    iformat = av_find_input_format(arg);
285
    if (!iformat) {
286
        fprintf(stderr, "Unknown input format: %s\n", arg);
287
        exit(1);
288
    }
289
}
290

  
281 291
static void opt_input_file(const char *filename)
282 292
{
283 293
    if (!strcmp(filename, "-"))
......
302 312

  
303 313
static const OptionDef options[] = {
304 314
#include "cmdutils_common_opts.h"
315
    { "f", HAS_ARG, {(void*)opt_format}, "force format", "format" },
305 316
    { "unit",          OPT_BOOL, {(void*)&show_value_unit},   "show unit of the displayed values" },
306 317
    { "prefix",        OPT_BOOL, {(void*)&use_value_prefix}, "use SI prefixes for the displayed values"  },
307 318
    { "byte_binary_prefix", OPT_BOOL, {(void*)&use_byte_value_binary_prefix},

Also available in: Unified diff