| 3181 | }; |
| 3182 | |
| 3183 | static int open_files(OptionGroupList *l, const char *inout, |
| 3184 | int (*open_file)(OptionsContext*, const char*)) |
| 3185 | { |
| 3186 | int i, ret; |
| 3187 | |
| 3188 | for (i = 0; i < l->nb_groups; i++) { |
| 3189 | OptionGroup *g = &l->groups[i]; |
| 3190 | OptionsContext o; |
| 3191 | |
| 3192 | init_options(&o); |
| 3193 | o.g = g; |
| 3194 | |
| 3195 | ret = parse_optgroup(&o, g); |
| 3196 | if (ret < 0) { |
| 3197 | av_log(NULL, AV_LOG_ERROR, "Error parsing options for %s file " |
| 3198 | "%s.\n", inout, g->arg); |
| 3199 | return ret; |
| 3200 | } |
| 3201 | |
| 3202 | av_log(NULL, AV_LOG_DEBUG, "Opening an %s file: %s.\n", inout, g->arg); |
| 3203 | ret = open_file(&o, g->arg); |
| 3204 | uninit_options(&o); |
| 3205 | if (ret < 0) { |
| 3206 | av_log(NULL, AV_LOG_ERROR, "Error opening %s file %s.\n", |
| 3207 | inout, g->arg); |
| 3208 | return ret; |
| 3209 | } |
| 3210 | av_log(NULL, AV_LOG_DEBUG, "Successfully opened the file.\n"); |
| 3211 | } |
| 3212 | |
| 3213 | return 0; |
| 3214 | } |
| 3215 | |
| 3216 | int ffmpeg_parse_options(int argc, char **argv) |
| 3217 | { |
no test coverage detected