diff options
Diffstat (limited to 'libmpcodecs/vf_qp.c')
-rw-r--r-- | libmpcodecs/vf_qp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libmpcodecs/vf_qp.c b/libmpcodecs/vf_qp.c index f7e8b377fe..fa25a4508f 100644 --- a/libmpcodecs/vf_qp.c +++ b/libmpcodecs/vf_qp.c @@ -66,11 +66,15 @@ static int config(struct vf_instance *vf, "qp", NULL }; + double temp_val; - const char *error = NULL; - vf->priv->lut[i+129]= lrintf(ff_parse_and_eval_expr(vf->priv->eq, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &error)); - if (error) - mp_msg(MSGT_VFILTER, MSGL_ERR, "qp: Error evaluating \"%s\": %s\n", vf->priv->eq, error); + temp_val= ff_parse_and_eval_expr(vf->priv->eq, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, NULL); + + if (isnan(temp_val)){ + mp_msg(MSGT_VFILTER, MSGL_ERR, "qp: Error evaluating \"%s\" \n", vf->priv->eq); + return 0; + } + vf->priv->lut[i+129]= lrintf(temp_val); } return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); |