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

j at svn.xiph.org j at svn.xiph.org
Sun Jun 14 12:24:24 PDT 2009


Author: j
Date: 2009-06-14 12:24:24 -0700 (Sun, 14 Jun 2009)
New Revision: 16133

Modified:
   trunk/ffmpeg2theora/src/avinfo.c
Log:
just add the data read

Modified: trunk/ffmpeg2theora/src/avinfo.c
===================================================================
--- trunk/ffmpeg2theora/src/avinfo.c	2009-06-14 19:08:53 UTC (rev 16132)
+++ trunk/ffmpeg2theora/src/avinfo.c	2009-06-14 19:24:24 UTC (rev 16133)
@@ -281,6 +281,7 @@
     int i;
     unsigned long long t1=0;
     unsigned long long buffer1[8192*2];
+    int used = 8192*2;
     struct stat st;
 
     file = fopen(filename, "rb");
@@ -289,15 +290,14 @@
         stat(filename, &st);
         t1 = st.st_size;
         if(t1 < 65536) {
-            fread(buffer1, t1/8, 8, file);
-            for (i=t1/8; i < 8192*2; i++)
-                buffer1[i] = 0;
+            used = t1/8;
+            fread(buffer1, used, 8, file);
         } else {
             fread(buffer1, 8192, 8, file);
             fseek(file, -65536, SEEK_END);
             fread(&buffer1[8192], 8192, 8, file); 
         }
-        for (i=0; i < 8192*2; i++)
+        for (i=0; i < used; i++)
             t1+=buffer1[i];
         fclose(file);
     }



More information about the commits mailing list