diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-12-08 19:12:42 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-12-08 22:18:38 +0100 |
commit | f494647206c2f6bd4ee5330685a0c6a9643b6e5c (patch) | |
tree | ef8f04bdc17a75ec2c53a15133b032b77b00fb77 /libavutil/opt.c | |
parent | f2c49da9ac486597a240cf62d23b8a85eb6fe6e9 (diff) | |
download | ffmpeg-streaming-f494647206c2f6bd4ee5330685a0c6a9643b6e5c.zip ffmpeg-streaming-f494647206c2f6bd4ee5330685a0c6a9643b6e5c.tar.gz |
lavu/opt: change the way ranges are printed
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index b8ad36f..d388b7d 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -750,7 +750,7 @@ static void log_value(void *av_log_obj, int level, double d) } else if (d == FLT_MIN) { av_log(av_log_obj, level, "FLT_MIN"); } else { - av_log(av_log_obj, level, "%7.2g", d); + av_log(av_log_obj, level, "%g", d); } } @@ -826,6 +826,9 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit, 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' : '.'); + if (opt->help) + av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help); + if (av_opt_query_ranges(&r, obj, opt->name, AV_OPT_SEARCH_FAKE_OBJ) >= 0) { switch (opt->type) { case AV_OPT_TYPE_INT: @@ -833,20 +836,18 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit, case AV_OPT_TYPE_DOUBLE: case AV_OPT_TYPE_FLOAT: case AV_OPT_TYPE_RATIONAL: - for (i = 0; i <r->nb_ranges; i++) { - av_log(av_log_obj, AV_LOG_INFO, "["); + for (i = 0; i < r->nb_ranges; i++) { + av_log(av_log_obj, AV_LOG_INFO, " (from "); log_value(av_log_obj, AV_LOG_INFO, r->range[i]->value_min); - av_log(av_log_obj, AV_LOG_INFO, ", "); + av_log(av_log_obj, AV_LOG_INFO, " to "); log_value(av_log_obj, AV_LOG_INFO, r->range[i]->value_max); - av_log(av_log_obj, AV_LOG_INFO, "]"); + av_log(av_log_obj, AV_LOG_INFO, ")"); } break; } av_opt_freep_ranges(&r); } - if (opt->help) - av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help); av_log(av_log_obj, AV_LOG_INFO, "\n"); if (opt->unit && opt->type != AV_OPT_TYPE_CONST) { opt_list(obj, av_log_obj, opt->unit, req_flags, rej_flags); |