diff options
author | Marton Balint <cus@passwd.hu> | 2024-05-18 15:55:18 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2024-05-27 21:46:47 +0200 |
commit | f9810be5d32fec736c65fcad07a7413546aeacef (patch) | |
tree | 05c36c2782ee816dceb9329b9f97c0b7399a997d /fftools/cmdutils.c | |
parent | 169b6ee732fdc35d0eb4be4d076d5265ce9b1304 (diff) | |
download | ffmpeg-f9810be5d32fec736c65fcad07a7413546aeacef.tar.gz |
fftools: move check_avoptions and remove_avoptions to cmdutils
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'fftools/cmdutils.c')
-rw-r--r-- | fftools/cmdutils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index a8f5c6d89b..9cdf92ff37 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -1146,3 +1146,23 @@ char *file_read(const char *filename) return NULL; return str; } + +void remove_avoptions(AVDictionary **a, AVDictionary *b) +{ + const AVDictionaryEntry *t = NULL; + + while ((t = av_dict_iterate(b, t))) { + av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE); + } +} + +int check_avoptions(AVDictionary *m) +{ + const AVDictionaryEntry *t = av_dict_iterate(m, NULL); + if (t) { + av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key); + return AVERROR_OPTION_NOT_FOUND; + } + + return 0; +} |