fftools: use av_dict_iterate

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Marvin Scholz 2022-11-26 15:46:18 +01:00 committed by Andreas Rheinhardt
parent 7b450bafd7
commit f1907faab4
7 changed files with 11 additions and 13 deletions

View File

@ -921,7 +921,7 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
break;
}
while (t = av_dict_get(opts, "", t, AV_DICT_IGNORE_SUFFIX)) {
while (t = av_dict_iterate(opts, t)) {
const AVClass *priv_class;
char *p = strchr(t->key, ':');

View File

@ -611,7 +611,7 @@ void remove_avoptions(AVDictionary **a, AVDictionary *b)
{
const AVDictionaryEntry *t = NULL;
while ((t = av_dict_get(b, "", t, AV_DICT_IGNORE_SUFFIX))) {
while ((t = av_dict_iterate(b, t))) {
av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE);
}
}

View File

@ -1082,13 +1082,12 @@ int ifile_open(const OptionsContext *o, const char *filename)
unused_opts = strip_specifiers(o->g->codec_opts);
for (i = 0; i < f->nb_streams; i++) {
e = NULL;
while ((e = av_dict_get(f->streams[i]->decoder_opts, "", e,
AV_DICT_IGNORE_SUFFIX)))
while ((e = av_dict_iterate(f->streams[i]->decoder_opts, e)))
av_dict_set(&unused_opts, e->key, NULL, 0);
}
e = NULL;
while ((e = av_dict_get(unused_opts, "", e, AV_DICT_IGNORE_SUFFIX))) {
while ((e = av_dict_iterate(unused_opts, e))) {
const AVClass *class = avcodec_get_class();
const AVOption *option = av_opt_find(&class, e->key, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);

View File

@ -452,8 +452,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
snprintf(args, sizeof(args), "%d:%d",
ofilter->width, ofilter->height);
while ((e = av_dict_get(ost->sws_dict, "", e,
AV_DICT_IGNORE_SUFFIX))) {
while ((e = av_dict_iterate(ost->sws_dict, e))) {
av_strlcatf(args, sizeof(args), ":%s=%s", e->key, e->value);
}

View File

@ -169,7 +169,7 @@ AVDictionary *strip_specifiers(const AVDictionary *dict)
const AVDictionaryEntry *e = NULL;
AVDictionary *ret = NULL;
while ((e = av_dict_get(dict, "", e, AV_DICT_IGNORE_SUFFIX))) {
while ((e = av_dict_iterate(dict, e))) {
char *p = strchr(e->key, ':');
if (p)

View File

@ -1860,7 +1860,7 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
}
pix_fmts[nb_pix_fmts] = AV_PIX_FMT_NONE;
while ((e = av_dict_get(sws_dict, "", e, AV_DICT_IGNORE_SUFFIX))) {
while ((e = av_dict_iterate(sws_dict, e))) {
if (!strcmp(e->key, "sws_flags")) {
av_strlcatf(sws_flags_str, sizeof(sws_flags_str), "%s=%s:", "flags", e->value);
} else
@ -1966,7 +1966,7 @@ static int configure_audio_filters(VideoState *is, const char *afilters, int for
av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
while ((e = av_dict_get(swr_opts, "", e, AV_DICT_IGNORE_SUFFIX)))
while ((e = av_dict_iterate(swr_opts, e)))
av_strlcatf(aresample_swr_opts, sizeof(aresample_swr_opts), "%s=%s:", e->key, e->value);
if (strlen(aresample_swr_opts))
aresample_swr_opts[strlen(aresample_swr_opts)-1] = '\0';

View File

@ -656,7 +656,7 @@ static int writer_open(WriterContext **wctx, const Writer *writer, const char *a
goto fail;
}
while ((opt = av_dict_get(opts, "", opt, AV_DICT_IGNORE_SUFFIX))) {
while ((opt = av_dict_iterate(opts, opt))) {
if ((ret = av_opt_set(*wctx, opt->key, opt->value, AV_OPT_SEARCH_CHILDREN)) < 0) {
av_log(*wctx, AV_LOG_ERROR, "Failed to set option '%s' with value '%s' provided to writer context\n",
opt->key, opt->value);
@ -1945,7 +1945,7 @@ static inline int show_tags(WriterContext *w, AVDictionary *tags, int section_id
return 0;
writer_print_section_header(w, section_id);
while ((tag = av_dict_get(tags, "", tag, AV_DICT_IGNORE_SUFFIX))) {
while ((tag = av_dict_iterate(tags, tag))) {
if ((ret = print_str_validate(tag->key, tag->value)) < 0)
break;
}
@ -3315,7 +3315,7 @@ static int open_input_file(InputFile *ifile, const char *filename,
ifile->fmt_ctx = fmt_ctx;
if (scan_all_pmts_set)
av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
while ((t = av_dict_get(format_opts, "", t, AV_DICT_IGNORE_SUFFIX)))
while ((t = av_dict_iterate(format_opts, t)))
av_log(NULL, AV_LOG_WARNING, "Option %s skipped - not known to demuxer.\n", t->key);
if (find_stream_info) {