diff mbox series

[FFmpeg-devel,09/38] lavu/opt: drop useless handling of NULL return from get_bool_name()

Message ID 20240223143115.16521-10-anton@khirnov.net
State Accepted
Commit 9fabdd64b2cd9b75337afe4f1f2268935a25d063
Headers show
Series [FFmpeg-devel,01/38] lavu/opt: cosmetics, change option flags to (1 << N) style | expand

Commit Message

Anton Khirnov Feb. 23, 2024, 1:58 p.m. UTC
That function always returns an actual string.
---
 libavutil/opt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 49b7da7742..0ffdfc9a1e 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -853,7 +853,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);
@@ -1282,7 +1282,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);