[xiph-commits] r16559 - trunk/ffmpeg2theora/src

j at svn.xiph.org j at svn.xiph.org
Tue Sep 22 11:49:23 PDT 2009


Author: j
Date: 2009-09-22 11:49:23 -0700 (Tue, 22 Sep 2009)
New Revision: 16559

Modified:
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
parse float framerates

Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2009-09-16 04:25:55 UTC (rev 16558)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2009-09-22 18:49:23 UTC (rev 16559)
@@ -1693,8 +1693,16 @@
         if (framerate.den <= 0)
             framerate.den = 1;
     } else {
-        framerate.num = strtol(arg, (char **)&arg,10);
-        framerate.den = 1;
+        p = strchr(arg, '.');
+        if (!p) {
+            framerate.num = strtol(arg, (char **)&arg, 10);
+            framerate.den = 1;
+        } else {
+            av_reduce(&framerate.num, &framerate.den,
+                      strtod(arg, (char **)&arg) * 10000,
+                      10000,
+                      1024*1024);
+        }
     }
     return(framerate);
 }



More information about the commits mailing list