| 412 | } |
| 413 | |
| 414 | int parse_optgroup(void *optctx, OptionGroup *g) |
| 415 | { |
| 416 | int i, ret; |
| 417 | |
| 418 | av_log(NULL, AV_LOG_DEBUG, "Parsing a group of options: %s %s.\n", |
| 419 | g->group_def->name, g->arg); |
| 420 | |
| 421 | for (i = 0; i < g->nb_opts; i++) { |
| 422 | Option *o = &g->opts[i]; |
| 423 | |
| 424 | if (g->group_def->flags && |
| 425 | !(g->group_def->flags & o->opt->flags)) { |
| 426 | av_log(NULL, AV_LOG_ERROR, "Option %s (%s) cannot be applied to " |
| 427 | "%s %s -- you are trying to apply an input option to an " |
| 428 | "output file or vice versa. Move this option before the " |
| 429 | "file it belongs to.\n", o->key, o->opt->help, |
| 430 | g->group_def->name, g->arg); |
| 431 | return AVERROR(EINVAL); |
| 432 | } |
| 433 | |
| 434 | av_log(NULL, AV_LOG_DEBUG, "Applying option %s (%s) with argument %s.\n", |
| 435 | o->key, o->opt->help, o->val); |
| 436 | |
| 437 | ret = write_option(optctx, o->opt, o->key, o->val); |
| 438 | if (ret < 0) |
| 439 | return ret; |
| 440 | } |
| 441 | |
| 442 | av_log(NULL, AV_LOG_DEBUG, "Successfully parsed a group of options.\n"); |
| 443 | |
| 444 | return 0; |
| 445 | } |
| 446 | |
| 447 | int locate_option(int argc, char **argv, const OptionDef *options, |
| 448 | const char *optname) |
no test coverage detected