Blame patches/libtheora/fix-timeb.patch

Lucio Andrés Illanes Albornoz e3166d
--- libtheora-1.1.1.orig/examples/dump_psnr.c
Lucio Andrés Illanes Albornoz e3166d
+++ libtheora-1.1.1/examples/dump_psnr.c
Lucio Andrés Illanes Albornoz e3166d
@@ -37,7 +37,6 @@
Lucio Andrés Illanes Albornoz e3166d
 #endif
Lucio Andrés Illanes Albornoz e3166d
 #include <stdlib.h>
Lucio Andrés Illanes Albornoz e3166d
 #include <string.h>
Lucio Andrés Illanes Albornoz e3166d
-#include <sys/timeb.h>
Lucio Andrés Illanes Albornoz e3166d
 #include <sys/types.h>
Lucio Andrés Illanes Albornoz e3166d
 #include <sys/stat.h>
Lucio Andrés Illanes Albornoz e3166d
 /*Yes, yes, we're going to hell.*/
Lucio Andrés Illanes Albornoz e3166d
--- libtheora-1.1.1.orig/examples/dump_video.c
Lucio Andrés Illanes Albornoz e3166d
+++ libtheora-1.1.1/examples/dump_video.c
Lucio Andrés Illanes Albornoz e3166d
@@ -37,7 +37,7 @@
Lucio Andrés Illanes Albornoz e3166d
 #include <stdio.h>
Lucio Andrés Illanes Albornoz e3166d
 #include <stdlib.h>
Lucio Andrés Illanes Albornoz e3166d
 #include <string.h>
Lucio Andrés Illanes Albornoz e3166d
-#include <sys/timeb.h>
Lucio Andrés Illanes Albornoz e3166d
+#include <sys/time.h>
Lucio Andrés Illanes Albornoz e3166d
 #include <sys/types.h>
Lucio Andrés Illanes Albornoz e3166d
 #include <sys/stat.h>
Lucio Andrés Illanes Albornoz e3166d
 /*Yes, yes, we're going to hell.*/
Lucio Andrés Illanes Albornoz e3166d
@@ -205,9 +205,9 @@
Lucio Andrés Illanes Albornoz e3166d
   int long_option_index;
Lucio Andrés Illanes Albornoz e3166d
   int c;
Lucio Andrés Illanes Albornoz e3166d
 
Lucio Andrés Illanes Albornoz e3166d
-  struct timeb start;
Lucio Andrés Illanes Albornoz e3166d
-  struct timeb after;
Lucio Andrés Illanes Albornoz e3166d
-  struct timeb last;
Lucio Andrés Illanes Albornoz e3166d
+  struct timeval start;
Lucio Andrés Illanes Albornoz e3166d
+  struct timeval after;
Lucio Andrés Illanes Albornoz e3166d
+  struct timeval last;
Lucio Andrés Illanes Albornoz e3166d
   int fps_only=0;
Lucio Andrés Illanes Albornoz e3166d
   int frames = 0;
Lucio Andrés Illanes Albornoz e3166d
 
Lucio Andrés Illanes Albornoz e3166d
@@ -418,8 +418,8 @@
Lucio Andrés Illanes Albornoz e3166d
   }
Lucio Andrés Illanes Albornoz e3166d
 
Lucio Andrés Illanes Albornoz e3166d
   if(fps_only){
Lucio Andrés Illanes Albornoz e3166d
-    ftime(&start;;
Lucio Andrés Illanes Albornoz e3166d
-    ftime(&last);
Lucio Andrés Illanes Albornoz e3166d
+    gettimeofday(&start, NULL);
Lucio Andrés Illanes Albornoz e3166d
+    gettimeofday(&last, NULL);
Lucio Andrés Illanes Albornoz e3166d
   }
Lucio Andrés Illanes Albornoz e3166d
 
Lucio Andrés Illanes Albornoz e3166d
   while(!got_sigint){
Lucio Andrés Illanes Albornoz e3166d
@@ -433,7 +433,7 @@
Lucio Andrés Illanes Albornoz e3166d
           videobuf_ready=1;
Lucio Andrés Illanes Albornoz e3166d
           frames++;
Lucio Andrés Illanes Albornoz e3166d
           if(fps_only)
Lucio Andrés Illanes Albornoz e3166d
-            ftime(&after);
Lucio Andrés Illanes Albornoz e3166d
+            gettimeofday(&after, NULL);
Lucio Andrés Illanes Albornoz e3166d
         }
Lucio Andrés Illanes Albornoz e3166d
 
Lucio Andrés Illanes Albornoz e3166d
       }else
Lucio Andrés Illanes Albornoz e3166d
@@ -442,16 +442,16 @@
Lucio Andrés Illanes Albornoz e3166d
 
Lucio Andrés Illanes Albornoz e3166d
     if(fps_only && (videobuf_ready || fps_only==2)){
Lucio Andrés Illanes Albornoz e3166d
       long ms =
Lucio Andrés Illanes Albornoz e3166d
-        after.time*1000.+after.millitm-
Lucio Andrés Illanes Albornoz e3166d
-        (last.time*1000.+last.millitm);
Lucio Andrés Illanes Albornoz e3166d
+        after.tv_sec*1000.+after.tv_usec/1000-
Lucio Andrés Illanes Albornoz e3166d
+        (last.tv_sec*1000.+last.tv_usec/1000);
Lucio Andrés Illanes Albornoz e3166d
 
Lucio Andrés Illanes Albornoz e3166d
       if(ms>500 || fps_only==1 ||
Lucio Andrés Illanes Albornoz e3166d
          (feof(infile) && !videobuf_ready)){
Lucio Andrés Illanes Albornoz e3166d
         float file_fps = (float)ti.fps_numerator/ti.fps_denominator;
Lucio Andrés Illanes Albornoz e3166d
         fps_only=2;
Lucio Andrés Illanes Albornoz e3166d
 
Lucio Andrés Illanes Albornoz e3166d
-        ms = after.time*1000.+after.millitm-
Lucio Andrés Illanes Albornoz e3166d
-          (start.time*1000.+start.millitm);
Lucio Andrés Illanes Albornoz e3166d
+        ms = after.tv_sec*1000.+after.tv_usec/1000-
Lucio Andrés Illanes Albornoz e3166d
+          (start.tv_sec*1000.+start.tv_usec/1000);
Lucio Andrés Illanes Albornoz e3166d
 
Lucio Andrés Illanes Albornoz e3166d
         fprintf(stderr,"\rframe:%d rate:%.2fx           ",
Lucio Andrés Illanes Albornoz e3166d
                 frames,