| 454 | } |
| 455 | |
| 456 | int parse_optgroup(void *optctx, OptionGroup *g, const OptionDef *defs) |
| 457 | { |
| 458 | int i, ret; |
| 459 | |
| 460 | av_log(NULL, AV_LOG_DEBUG, "Parsing a group of options: %s %s.\n", |
| 461 | g->group_def->name, g->arg); |
| 462 | |
| 463 | for (i = 0; i < g->nb_opts; i++) { |
| 464 | Option *o = &g->opts[i]; |
| 465 | |
| 466 | if (g->group_def->flags && |
| 467 | !(g->group_def->flags & o->opt->flags)) { |
| 468 | av_log(NULL, AV_LOG_ERROR, "Option %s (%s) cannot be applied to " |
| 469 | "%s %s -- you are trying to apply an input option to an " |
| 470 | "output file or vice versa. Move this option before the " |
| 471 | "file it belongs to.\n", o->key, o->opt->help, |
| 472 | g->group_def->name, g->arg); |
| 473 | return AVERROR(EINVAL); |
| 474 | } |
| 475 | |
| 476 | av_log(NULL, AV_LOG_DEBUG, "Applying option %s (%s) with argument %s.\n", |
| 477 | o->key, o->opt->help, o->val); |
| 478 | |
| 479 | ret = write_option(optctx, o->opt, o->key, o->val, defs); |
| 480 | if (ret < 0) |
| 481 | return ret; |
| 482 | } |
| 483 | |
| 484 | av_log(NULL, AV_LOG_DEBUG, "Successfully parsed a group of options.\n"); |
| 485 | |
| 486 | return 0; |
| 487 | } |
| 488 | |
| 489 | int locate_option(int argc, char **argv, const OptionDef *options, |
| 490 | const char *optname) |
no test coverage detected