mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-23 18:14:06 +00:00
Fail encoder init when CQM file cannot be opened
This commit is contained in:
parent
db5e750c7f
commit
97863cdaa2
|
@ -203,16 +203,18 @@ encoder_control_t* kvz_encoder_control_init(kvz_config *const cfg) {
|
|||
kvz_scalinglist_init(&encoder->scaling_list);
|
||||
|
||||
// CQM
|
||||
{
|
||||
FILE* cqmfile;
|
||||
cqmfile = cfg->cqmfile ? fopen(cfg->cqmfile, "rb") : NULL;
|
||||
if (cfg->cqmfile) {
|
||||
FILE* cqmfile = fopen(cfg->cqmfile, "rb");
|
||||
if (cqmfile) {
|
||||
kvz_scalinglist_parse(&encoder->scaling_list, cqmfile);
|
||||
fclose(cqmfile);
|
||||
} else {
|
||||
fprintf(stderr, "Could not open CQM file.\n");
|
||||
goto init_failed;
|
||||
}
|
||||
}
|
||||
kvz_scalinglist_process(&encoder->scaling_list, encoder->bitdepth);
|
||||
|
||||
|
||||
kvz_encoder_control_input_init(encoder, cfg->width, cfg->height);
|
||||
|
||||
if (cfg->framerate_num != 0) {
|
||||
|
|
Loading…
Reference in a new issue