summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-02-08 15:15:08 +0100
committerAnton Khirnov <anton@khirnov.net>2024-03-01 16:57:24 +0100
commit9fabdd64b2cd9b75337afe4f1f2268935a25d063 (patch)
tree75f48beca836a06d8fd5276cde848f37c5e71969
parent333cc9bff8466be760d27815bed745fe2a893dff (diff)
lavu/opt: drop useless handling of NULL return from get_bool_name()
That function always returns an actual string.
-rw-r--r--libavutil/opt.c4
1 files 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);