[FFmpeg-cvslog] lavu/opt-test: do not explicitly set default value in test_ctx
Stefano Sabatini
git at videolan.org
Tue Mar 5 13:22:09 CET 2013
ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Mon Mar 4 18:34:35 2013 +0100| [7b9a3df5d71677c9a03ffea1699c416883c5d176] | committer: Stefano Sabatini
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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7b9a3df5d71677c9a03ffea1699c416883c5d176
---
libavutil/opt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 61c76da..211ca5e 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);
More information about the ffmpeg-cvslog
mailing list