- if(sscanf(argv[++i], "%d:%d", &config->aspectwidth, &config->aspectheight)
- != 2) {
- print_usage(argv[0]);
- throw std::runtime_error("Invalid aspect spec, should be WIDTH:HEIGHT");
+ if(strcasecmp(argv[i], "auto") == 0) {
+ config->aspect_ratio = -1;
+ } else {
+ int aspect_width, aspect_height;
+ if(sscanf(argv[++i], "%d:%d", &aspect_width, &aspect_height) != 2) {
+ print_usage(argv[0]);
+ throw std::runtime_error("Invalid aspect spec, should be WIDTH:HEIGHT");
+ }
+ config->aspect_ratio = static_cast<double>(aspect_width) /
+ static_cast<double>(aspect_height);