Added more clear error message in case of failed config read.

This commit is contained in:
Dmitriy Alexandrov 2022-10-27 12:42:25 +04:00
parent d21361a883
commit 4248f58f32
1 changed files with 10 additions and 1 deletions

View File

@ -1045,7 +1045,16 @@ ff_load_config(int argc, char *const argv[])
ret = ini_parse(ff_global_cfg.filename, ini_parse_handler,
&ff_global_cfg);
if (ret != 0) {
printf("parse %s failed on line %d\n", ff_global_cfg.filename, ret);
switch(ret) {
case -1:
printf("failed to open file %s\n", ff_global_cfg.filename);
break;
case -2:
printf("failed to allocate memory for config parsing\n");
break;
default:
printf("parse %s failed on line %d\n", ff_global_cfg.filename, ret);
}
return -1;
}