[FFmpeg-cvslog] eval: fix printing of NaN in eval fate test.

Ronald S. Bultje git at videolan.org
Sat Jul 28 00:10:45 CEST 2012


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Wed Jul 25 20:42:04 2012 -0700| [02ac28229aa6824455e2cbc2389355575913041a] | committer: Ronald S. Bultje

eval: fix printing of NaN in eval fate test.

This fixes "make fate-eval" on MSVC builds. Without this, the test outputs
"-1.#NaN" instead of "nan" on MSVS 2010.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=02ac28229aa6824455e2cbc2389355575913041a
---

 libavutil/eval.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavutil/eval.c b/libavutil/eval.c
index ff3191d..d274272 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -636,7 +636,10 @@ int main(int argc, char **argv)
         av_expr_parse_and_eval(&d, *expr,
                                const_names, const_values,
                                NULL, NULL, NULL, NULL, NULL, 0, NULL);
-        printf("'%s' -> %f\n\n", *expr, d);
+        if (isnan(d))
+            printf("'%s' -> nan\n\n", *expr);
+        else
+            printf("'%s' -> %f\n\n", *expr, d);
     }
 
     av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",



More information about the ffmpeg-cvslog mailing list