Skip to content

Commit

Permalink
Add code paths for string type options to appear in the feature name
Browse files Browse the repository at this point in the history
  • Loading branch information
nilfm99 committed Feb 14, 2024
1 parent 8dff61b commit ef89ac4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libvmaf/src/feature/feature_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ static int option_is_default(const VmafOption *opt, const void *data)
return opt->default_val.i == *((int*)data);
case VMAF_OPT_TYPE_DOUBLE:
return opt->default_val.d == *((double*)data);
case VMAF_OPT_TYPE_STRING:
return !strcmp(opt->default_val.s, *((char**)data));
default:
return -EINVAL;
}
Expand Down Expand Up @@ -136,6 +138,9 @@ char *vmaf_feature_name_from_options(const char *name, const VmafOption *opts,
case VMAF_OPT_TYPE_DOUBLE:
snprintf(buf, buf_sz, "%g", *((double*)data));
break;
case VMAF_OPT_TYPE_STRING:
snprintf(buf, buf_sz, "%s", *((char**)data));
break;
default:
break;
}
Expand Down

0 comments on commit ef89ac4

Please sign in to comment.