Add video dimensions to the filename of encoder reconstruction.

This commit is contained in:
Ari Koivula 2014-03-10 17:49:54 +02:00
parent 965d8c377a
commit 1b2705a042

View file

@ -138,6 +138,17 @@ int main(int argc, char *argv[])
return EXIT_FAILURE; return EXIT_FAILURE;
} }
// Add dimensions to the reconstructions file name.
if (cfg->debug != NULL) {
char dim_str[50]; // log10(2^64) < 20, so this should suffice. I hate C.
size_t left_len, right_len;
sprintf(dim_str, "_%dx%d.yuv", cfg->width, cfg->height);
left_len = strlen(cfg->debug);
right_len = strlen(dim_str);
realloc(cfg->debug, left_len + right_len + 1);
strcpy(cfg->debug + left_len, dim_str);
}
// Do more validation to make sure the parameters we have make sense. // Do more validation to make sure the parameters we have make sense.
if (!config_validate(cfg)) { if (!config_validate(cfg)) {
config_destroy(cfg); config_destroy(cfg);