avoid stdio.h
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 11 Sep 2005 23:19:57 +0000 (23:19 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 11 Sep 2005 23:19:57 +0000 (23:19 +0000)
Originally committed as revision 4585 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffmpeg.c
libavcodec/opt.c
libavcodec/opt.h

index 6ffb423..a66908f 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -4495,7 +4495,7 @@ static void show_help(void)
     show_help_options(options, "\nAdvanced options:\n",
                       OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, 
                       OPT_EXPERT);
-    av_opt_show(avctx_opts, stdout);
+    av_opt_show(avctx_opts, NULL);
                          
     exit(1);
 }
index fc8f284..bf49767 100644 (file)
@@ -24,7 +24,6 @@
  * @author Michael Niedermayer <michaelni@gmx.at>
  */
  
-#include <stdio.h> //for FILE *
 #include "avcodec.h"
  
 static double av_parse_num(const char *name, char **tail){
@@ -224,26 +223,26 @@ int64_t av_get_int(void *obj, const char *name, AVOption **o_out){
     return num*intnum/den;
 }
 
-int av_opt_show(void *obj, FILE *f){
+int av_opt_show(void *obj, void *av_log_obj){
     AVOption *opt=NULL;
     
     if(!obj)
         return -1;
-#undef fprintf
-    fprintf(f, "%s AVOptions:\n", (*(AVClass**)obj)->class_name);
+
+    av_log(av_log_obj, AV_LOG_INFO, "%s AVOptions:\n", (*(AVClass**)obj)->class_name);
 
     while((opt= av_next_option(obj, opt))){
         if(!(opt->flags & (AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM)))
             continue;
             
-        fprintf(f, "-%-17s ", opt->name);
-        fprintf(f, "%c", (opt->flags & AV_OPT_FLAG_ENCODING_PARAM) ? 'E' : '.');
-        fprintf(f, "%c", (opt->flags & AV_OPT_FLAG_DECODING_PARAM) ? 'D' : '.');
-        fprintf(f, "%c", (opt->flags & AV_OPT_FLAG_VIDEO_PARAM   ) ? 'V' : '.');
-        fprintf(f, "%c", (opt->flags & AV_OPT_FLAG_AUDIO_PARAM   ) ? 'A' : '.');
-        fprintf(f, "%c", (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.');
+        av_log(av_log_obj, AV_LOG_INFO, "-%-17s ", opt->name);
+        av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_ENCODING_PARAM) ? 'E' : '.');
+        av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_DECODING_PARAM) ? 'D' : '.');
+        av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_VIDEO_PARAM   ) ? 'V' : '.');
+        av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_AUDIO_PARAM   ) ? 'A' : '.');
+        av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.');
         
-        fprintf(f, " %s\n", opt->help);
+        av_log(av_log_obj, AV_LOG_INFO, " %s\n", opt->help);
     }
     return 0;
 }
index 7b2fe47..c84db00 100644 (file)
@@ -56,6 +56,6 @@ AVRational av_get_q(void *obj, const char *name, AVOption **o_out);
 int64_t av_get_int(void *obj, const char *name, AVOption **o_out);
 const char *av_get_string(void *obj, const char *name, AVOption **o_out, char *buf, int buf_len);
 AVOption *av_next_option(void *obj, AVOption *last);
-int av_opt_show(void *obj, FILE *f);
+int av_opt_show(void *obj, void *av_log_obj);
 
 #endif