diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2013-03-04 18:34:35 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2013-03-05 13:20:14 +0100 |
commit | 7b9a3df5d71677c9a03ffea1699c416883c5d176 (patch) | |
tree | 523996ba2d365e721a062ce8ad320c607180c152 /libavutil/opt.c | |
parent | aba18c5af9e7c4775c0fe69a9e3adc26d1efda41 (diff) | |
download | ffmpeg-7b9a3df5d71677c9a03ffea1699c416883c5d176.tar.gz |
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.
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index 61c76daa6e..211ca5e317 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -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); |