]> git.sesse.net Git - ffmpeg/commitdiff
Use M_PI from libavutil/mathematics.h instead of defining PI ourselves
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 2 Oct 2008 16:29:15 +0000 (16:29 +0000)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 2 Oct 2008 16:29:15 +0000 (16:29 +0000)
in libavcodec/apiexample.c.

Originally committed as revision 15520 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/apiexample.c

index 793cfaa04072804d7d36072e19a6d10e08befbea..11cc1559dae8af0e3aa2cda544a0fa01fffea46b 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <math.h>
-
-#define PI 3.14159265358979323846
 
 #ifdef HAVE_AV_CONFIG_H
 #undef HAVE_AV_CONFIG_H
 #endif
 
 #include "avcodec.h"
+#include "libavutil/mathematics.h"
 
 #define INBUF_SIZE 4096
 
@@ -91,7 +89,7 @@ void audio_encode_example(const char *filename)
 
     /* encode a single tone sound */
     t = 0;
-    tincr = 2 * PI * 440.0 / c->sample_rate;
+    tincr = 2 * M_PI * 440.0 / c->sample_rate;
     for(i=0;i<200;i++) {
         for(j=0;j<frame_size;j++) {
             samples[2*j] = (int)(sin(t) * 10000);