| 1443 | }; |
| 1444 | |
| 1445 | static int open_files(OptionGroupList *l, const char *inout, Scheduler *sch, |
| 1446 | int (*open_file)(const OptionsContext*, const char*, |
| 1447 | Scheduler*)) |
| 1448 | { |
| 1449 | int i, ret; |
| 1450 | |
| 1451 | for (i = 0; i < l->nb_groups; i++) { |
| 1452 | OptionGroup *g = &l->groups[i]; |
| 1453 | OptionsContext o; |
| 1454 | |
| 1455 | init_options(&o); |
| 1456 | o.g = g; |
| 1457 | |
| 1458 | ret = parse_optgroup(&o, g, options); |
| 1459 | if (ret < 0) { |
| 1460 | av_log(NULL, AV_LOG_ERROR, "Error parsing options for %s file " |
| 1461 | "%s.\n", inout, g->arg); |
| 1462 | uninit_options(&o); |
| 1463 | return ret; |
| 1464 | } |
| 1465 | |
| 1466 | av_log(NULL, AV_LOG_DEBUG, "Opening an %s file: %s.\n", inout, g->arg); |
| 1467 | ret = open_file(&o, g->arg, sch); |
| 1468 | uninit_options(&o); |
| 1469 | if (ret < 0) { |
| 1470 | av_log(NULL, AV_LOG_ERROR, "Error opening %s file %s.\n", |
| 1471 | inout, g->arg); |
| 1472 | return ret; |
| 1473 | } |
| 1474 | av_log(NULL, AV_LOG_DEBUG, "Successfully opened the file.\n"); |
| 1475 | } |
| 1476 | |
| 1477 | return 0; |
| 1478 | } |
| 1479 | |
| 1480 | int ffmpeg_parse_options(int argc, char **argv, Scheduler *sch) |
| 1481 | { |
no test coverage detected