[Ffmpeg-cvslog] r8025 - trunk/libavcodec/apiexample.c

takis subversion
Sun Feb 18 22:23:51 CET 2007


Author: takis
Date: Sun Feb 18 22:23:50 2007
New Revision: 8025

Modified:
   trunk/libavcodec/apiexample.c

Log:
Remove a non-C dependency (being M_PI) from the libavcodec example.


Modified: trunk/libavcodec/apiexample.c
==============================================================================
--- trunk/libavcodec/apiexample.c	(original)
+++ trunk/libavcodec/apiexample.c	Sun Feb 18 22:23:50 2007
@@ -32,6 +32,8 @@
 #include <string.h>
 #include <math.h>
 
+#define PI 3.14159265358979323846
+
 #ifdef HAVE_AV_CONFIG_H
 #undef HAVE_AV_CONFIG_H
 #endif
@@ -89,7 +91,7 @@
 
     /* encode a single tone sound */
     t = 0;
-    tincr = 2 * M_PI * 440.0 / c->sample_rate;
+    tincr = 2 * 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);




More information about the ffmpeg-cvslog mailing list