[FFmpeg-cvslog] lavu/opt: drop useless handling of NULL return from get_bool_name()

Anton Khirnov git at videolan.org
Fri Mar 1 18:17:19 EET 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Feb  8 15:15:08 2024 +0100| [9fabdd64b2cd9b75337afe4f1f2268935a25d063] | committer: Anton Khirnov

lavu/opt: drop useless handling of NULL return from get_bool_name()

That function always returns an actual string.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9fabdd64b2cd9b75337afe4f1f2268935a25d063
---

 libavutil/opt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 48ff586d81..4ae017f9ec 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -863,7 +863,7 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
     buf[0] = 0;
     switch (o->type) {
     case AV_OPT_TYPE_BOOL:
-        ret = snprintf(buf, sizeof(buf), "%s", (char *)av_x_if_null(get_bool_name(*(int *)dst), "invalid"));
+        ret = snprintf(buf, sizeof(buf), "%s", get_bool_name(*(int *)dst));
         break;
     case AV_OPT_TYPE_FLAGS:
         ret = snprintf(buf, sizeof(buf), "0x%08X", *(int *)dst);
@@ -1292,7 +1292,7 @@ static void log_default(void *obj, void *av_log_obj, const AVOption *opt)
     av_log(av_log_obj, AV_LOG_INFO, " (default ");
     switch (opt->type) {
     case AV_OPT_TYPE_BOOL:
-        av_log(av_log_obj, AV_LOG_INFO, "%s", (char *)av_x_if_null(get_bool_name(opt->default_val.i64), "invalid"));
+        av_log(av_log_obj, AV_LOG_INFO, "%s", get_bool_name(opt->default_val.i64));
         break;
     case AV_OPT_TYPE_FLAGS: {
         char *def_flags = get_opt_flags_string(obj, opt->unit, opt->default_val.i64);



More information about the ffmpeg-cvslog mailing list