summaryrefslogtreecommitdiff
path: root/libavcodec/librav1e.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2019-12-25 01:55:25 +0100
committerMarton Balint <cus@passwd.hu>2020-01-01 21:22:11 +0100
commite47a95463116b17a6e96ef87e1341b5544747982 (patch)
tree55545d3c2486b5170ded31bcaf86bbafaf141a26 /libavcodec/librav1e.c
parenta613d042e71b44be7d0626c05e2c6360f7e75ebe (diff)
downloadffmpeg-e47a95463116b17a6e96ef87e1341b5544747982.tar.gz
avcodec/librav1e: use AV_OPT_TYPE_DICT for rav1e-params
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavcodec/librav1e.c')
-rw-r--r--libavcodec/librav1e.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c
index a5aedd512c..b8b1b4f8f1 100644
--- a/libavcodec/librav1e.c
+++ b/libavcodec/librav1e.c
@@ -42,7 +42,7 @@ typedef struct librav1eContext {
size_t pass_pos;
int pass_size;
- char *rav1e_opts;
+ AVDictionary *rav1e_opts;
int quantizer;
int speed;
int tiles;
@@ -244,17 +244,12 @@ static av_cold int librav1e_encode_init(AVCodecContext *avctx)
}
}
- if (ctx->rav1e_opts) {
- AVDictionary *dict = NULL;
+ {
AVDictionaryEntry *en = NULL;
-
- if (!av_dict_parse_string(&dict, ctx->rav1e_opts, "=", ":", 0)) {
- while (en = av_dict_get(dict, "", en, AV_DICT_IGNORE_SUFFIX)) {
- int parse_ret = rav1e_config_parse(cfg, en->key, en->value);
- if (parse_ret < 0)
- av_log(avctx, AV_LOG_WARNING, "Invalid value for %s: %s.\n", en->key, en->value);
- }
- av_dict_free(&dict);
+ while ((en = av_dict_get(ctx->rav1e_opts, "", en, AV_DICT_IGNORE_SUFFIX))) {
+ int parse_ret = rav1e_config_parse(cfg, en->key, en->value);
+ if (parse_ret < 0)
+ av_log(avctx, AV_LOG_WARNING, "Invalid value for %s: %s.\n", en->key, en->value);
}
}
@@ -538,7 +533,7 @@ static const AVOption options[] = {
{ "tiles", "number of tiles encode with", OFFSET(tiles), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },
{ "tile-rows", "number of tiles rows to encode with", OFFSET(tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },
{ "tile-columns", "number of tiles columns to encode with", OFFSET(tile_cols), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },
- { "rav1e-params", "set the rav1e configuration using a :-separated list of key=value parameters", OFFSET(rav1e_opts), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
+ { "rav1e-params", "set the rav1e configuration using a :-separated list of key=value parameters", OFFSET(rav1e_opts), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE },
{ NULL }
};