diff options
author | iive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-05-20 23:17:41 +0000 |
---|---|---|
committer | iive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-05-20 23:17:41 +0000 |
commit | 31bc24b1d87427736630b1d516d0a60d9877bd9c (patch) | |
tree | 0c1877853ca89e55953463be8dca0e17dc3ddaa2 /libmpcodecs | |
parent | 764539a98c58dbb19c8bf380444be2bb374241bc (diff) |
Fix compilation broken by FFmpeg-r23201 that changed the api of error logging.
Also fix evaluation after FFmpeg-r23149 "change order of parameters".
Let the filters fail if evaluation can't be done.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31187 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vf_geq.c | 6 | ||||
-rw-r--r-- | libmpcodecs/vf_qp.c | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/libmpcodecs/vf_geq.c b/libmpcodecs/vf_geq.c index 6065b8d905..61e6d5cdf7 100644 --- a/libmpcodecs/vf_geq.c +++ b/libmpcodecs/vf_geq.c @@ -178,11 +178,11 @@ static int vf_open(vf_instance_t *vf, char *args){ plane==0 ? lum : (plane==1 ? cb : cr), NULL }; - char * a; - vf->priv->e[plane] = ff_parse_expr(eq[plane], const_names, NULL, NULL, func2, func2_names, &a); + vf->priv->e[plane] = ff_parse_expr(eq[plane], const_names, NULL, NULL, func2_names, func2, 0, NULL); if (!vf->priv->e[plane]) { - mp_msg(MSGT_VFILTER, MSGL_ERR, "geq: error loading equation `%s': %s\n", eq[plane], a); + mp_msg(MSGT_VFILTER, MSGL_ERR, "geq: error loading equation `%s'\n", eq[plane]); + return 0; } } diff --git a/libmpcodecs/vf_qp.c b/libmpcodecs/vf_qp.c index 0296a58b46..cd933f1c3a 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); |