From a1689e2f19957c45b6f2b2fc0063b304826a8887 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 11 Sep 2005 23:19:57 +0000 Subject: avoid stdio.h Originally committed as revision 4585 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 2 +- libavcodec/opt.c | 21 ++++++++++----------- libavcodec/opt.h | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 6ffb4232c7..a66908f2a2 100644 --- 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); } diff --git a/libavcodec/opt.c b/libavcodec/opt.c index fc8f28462b..bf49767185 100644 --- a/libavcodec/opt.c +++ b/libavcodec/opt.c @@ -24,7 +24,6 @@ * @author Michael Niedermayer */ -#include //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; } diff --git a/libavcodec/opt.h b/libavcodec/opt.h index 7b2fe47c66..c84db00fed 100644 --- a/libavcodec/opt.h +++ b/libavcodec/opt.h @@ -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 -- cgit v1.2.3