lavu/opt-test: do not explicitly set default value in test_ctx
Let av_opt_set_defaults() set the value, which is simpler and more idiomatic.
This commit is contained in:
parent
aba18c5af9
commit
7b9a3df5d7
@ -1323,7 +1323,7 @@ static const AVOption test_options[]= {
|
||||
{"num", "set num", OFFSET(num), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 100 },
|
||||
{"toggle", "set toggle", OFFSET(toggle), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1 },
|
||||
{"rational", "set rational", OFFSET(rational), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, 10 },
|
||||
{"string", "set string", OFFSET(string), AV_OPT_TYPE_STRING, {0}, CHAR_MIN, CHAR_MAX },
|
||||
{"string", "set string", OFFSET(string), AV_OPT_TYPE_STRING, {.str = "default"}, CHAR_MIN, CHAR_MAX },
|
||||
{"flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, 0, INT_MAX, 0, "flags" },
|
||||
{"cool", "set cool flag ", 0, AV_OPT_TYPE_CONST, {.i64 = TEST_FLAG_COOL}, INT_MIN, INT_MAX, 0, "flags" },
|
||||
{"lame", "set lame flag ", 0, AV_OPT_TYPE_CONST, {.i64 = TEST_FLAG_LAME}, INT_MIN, INT_MAX, 0, "flags" },
|
||||
@ -1385,7 +1385,6 @@ int main(void)
|
||||
|
||||
test_ctx.class = &test_class;
|
||||
av_opt_set_defaults(&test_ctx);
|
||||
test_ctx.string = av_strdup("default");
|
||||
|
||||
av_log_set_level(AV_LOG_DEBUG);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user