summaryrefslogtreecommitdiff
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2019-12-25 01:46:37 +0100
committerMarton Balint <cus@passwd.hu>2020-01-01 20:41:34 +0100
commitdfea6d2e5026477e503fbfffb3d3967424d9f6b3 (patch)
tree7f28f169904896d35a72fc0e82c230d336116459 /libavcodec/libx264.c
parent9ac1066dc6b52dd97b654369d08a78972dd30228 (diff)
avcodec/libx264: use AV_OPT_TYPE_DICT for x264-params
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index bfd91bb900..77bf88748f 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -95,7 +95,7 @@ typedef struct X264Context {
int scenechange_threshold;
int noise_reduction;
- char *x264_params;
+ AVDictionary *x264_params;
int nb_reordered_opaque, next_reordered_opaque;
int64_t *reordered_opaque;
@@ -892,19 +892,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
}
- if (x4->x264_params) {
- AVDictionary *dict = NULL;
- AVDictionaryEntry *en = NULL;
-
- if (!av_dict_parse_string(&dict, x4->x264_params, "=", ":", 0)) {
- while ((en = av_dict_get(dict, "", en, AV_DICT_IGNORE_SUFFIX))) {
- if (x264_param_parse(&x4->params, en->key, en->value) < 0)
- av_log(avctx, AV_LOG_WARNING,
- "Error parsing option '%s = %s'.\n",
- en->key, en->value);
- }
- av_dict_free(&dict);
+ {
+ AVDictionaryEntry *en = NULL;
+ while (en = av_dict_get(x4->x264_params, "", en, AV_DICT_IGNORE_SUFFIX)) {
+ if (x264_param_parse(&x4->params, en->key, en->value) < 0)
+ av_log(avctx, AV_LOG_WARNING,
+ "Error parsing option '%s = %s'.\n",
+ en->key, en->value);
}
}
@@ -1116,7 +1111,7 @@ static const AVOption options[] = {
{ "sc_threshold", "Scene change threshold", OFFSET(scenechange_threshold), AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, VE },
{ "noise_reduction", "Noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, VE },
- { "x264-params", "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
+ { "x264-params", "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE },
{ NULL },
};