Browse code

cmdutils: remove list_fmts(), simplify

The function was only used in opt_sample_fmt() for listing the sample
formats. Move list_fmts() functionality directly into
opt_sample_fmt().

Als fix the warning:
ffmpeg.c: In function ‘opt_audio_sample_fmt’:
ffmpeg.c:2877: warning: passing argument 1 of ‘list_fmts’ from incompatible pointer type
cmdutils.h:163: note: expected ‘void (*)(char *, int, int)’ but argument is of type ‘char * (*)(char *, int, enum AVSampleFormat)’

Stefano Sabatini authored on 2011/03/12 20:44:22
Showing 3 changed files
... ...
@@ -508,16 +508,6 @@ void show_license(void)
508 508
     );
509 509
 }
510 510
 
511
-void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts)
512
-{
513
-    int i;
514
-    char fmt_str[128];
515
-    for (i=-1; i < nb_fmts; i++) {
516
-        get_fmt_string (fmt_str, sizeof(fmt_str), i);
517
-        fprintf(stdout, "%s\n", fmt_str);
518
-    }
519
-}
520
-
521 511
 void show_formats(void)
522 512
 {
523 513
     AVInputFormat *ifmt=NULL;
... ...
@@ -161,8 +161,6 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec);
161 161
  */
162 162
 void print_error(const char *filename, int err);
163 163
 
164
-void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts);
165
-
166 164
 /**
167 165
  * Print the program banner to stderr. The banner contents depend on the
168 166
  * current version of the repository and of the libav* libraries used by
... ...
@@ -2850,7 +2850,10 @@ static void opt_audio_sample_fmt(const char *arg)
2850 2850
             ffmpeg_exit(1);
2851 2851
         }
2852 2852
     } else {
2853
-        list_fmts(av_get_sample_fmt_string, AV_SAMPLE_FMT_NB);
2853
+        int i;
2854
+        char fmt_str[128];
2855
+        for (i = -1; i < AV_SAMPLE_FMT_NB; i++)
2856
+            printf("%s\n", av_get_sample_fmt_string(fmt_str, sizeof(fmt_str), i));
2854 2857
         ffmpeg_exit(0);
2855 2858
     }
2856 2859
 }