case AVERROR_IO: fprintf(stderr, "%s: I/O error occured\n" "Usually that means that input file is truncated and/or corrupted.\n", filename); break; case AVERROR_NOMEM: fprintf(stderr, "%s: memory allocation error occured\n", filename); break;
void print_error(const char *filename, int err){    switch(err) {    case AVERROR_NUMEXPECTED:        fprintf(stderr, "%s: Incorrect image filename syntax.\n"                "Use '%%d' to specify the image number:\n"                "  for img1.jpg, img2.jpg, ..., use 'img%%d.jpg';\n"                "  for img001.jpg, img002.jpg, ..., use 'img%%03d.jpg'.\n",                 filename);        break;    case AVERROR_INVALIDDATA:        fprintf(stderr, "%s: Error while parsing header\n", filename);        break;    case AVERROR_NOFMT:        fprintf(stderr, "%s: Unknown format\n", filename);        break;    default:        fprintf(stderr, "%s: Error while opening file\n", filename);        break;    }}