diff ratecontrol.c @ 3775:8e1ed8300165 libavcodec

Make ratecontrol use ff_eval2().
author takis
date Wed, 27 Sep 2006 19:46:19 +0000
parents acf9ca729bd2
children 616a81d04758
line wrap: on
line diff
--- a/ratecontrol.c	Wed Sep 27 11:09:35 2006 +0000
+++ b/ratecontrol.c	Wed Sep 27 19:46:19 2006 +0000
@@ -259,6 +259,7 @@
     const int pict_type= rce->new_pict_type;
     const double mb_num= s->mb_num;
     int i;
+    char *error = NULL;
 
     double const_values[]={
         M_PI,
@@ -325,9 +326,9 @@
         NULL
     };
 
-    bits= ff_eval(s->avctx->rc_eq, const_values, const_names, func1, func1_names, NULL, NULL, rce);
+    bits= ff_eval2(s->avctx->rc_eq, const_values, const_names, func1, func1_names, NULL, NULL, rce, &error);
     if (isnan(bits)) {
-        av_log(s->avctx, AV_LOG_ERROR, "Unable to parse rc_eq \"%s\".\n", s->avctx->rc_eq);
+        av_log(s->avctx, AV_LOG_ERROR, "Error evaluating rc_eq \"%s\": %s\n", s->avctx->rc_eq, error? error : "");
         return -1;
     }