fftools/ffmpeg: change the MATCH_PER_TYPE_OPT macro into a function

There is no reason for it to be a macro anymore, this makes the code
using it cleaner and simpler.
This commit is contained in:
Anton Khirnov
2023-12-17 14:42:38 +01:00
parent 0ba70a6792
commit 148fac277a
6 changed files with 33 additions and 23 deletions

View File

@@ -239,14 +239,15 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
* a global var*/
void *dst = po->flags & OPT_FLAG_OFFSET ?
(uint8_t *)optctx + po->u.off : po->u.dst_ptr;
SpecifierOptList *sol = NULL;
double num;
int ret;
if (po->flags & OPT_FLAG_SPEC) {
SpecifierOptList *sol = dst;
char *p = strchr(opt, ':');
char *str;
sol = dst;
ret = GROW_ARRAY(sol->opt, sol->nb_opt);
if (ret < 0)
return ret;
@@ -312,6 +313,9 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
if (po->flags & OPT_EXIT)
return AVERROR_EXIT;
if (sol)
sol->type = po->type;
return 0;
}