1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
--- editor/editor.C.orig Sun Jun 18 07:27:07 1995
+++ editor/editor.C Fri Dec 7 21:02:51 2001
@@ -45,11 +45,13 @@
#include <stdio.h>
#include <time.h>
#include <unistd.h>
+#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include "pbmplus.h"
+extern "C" {
#include "pnm.h"
+}
#define del(x) delete x; x = NULL;
@@ -3249,17 +3251,17 @@
wins[0] = play_btn->WinId();
play_btn->RestrictEvents(wins,1);
- gettimeofday(&target,(timezone *)NULL); // Time a read, to
+ gettimeofday(&target,(struct timezone *)NULL); // Time a read, to
ret_stat = Codec_stream->Read(temp_frame); // find out how long
- gettimeofday(&clk,(timezone *)NULL); // it takes
+ gettimeofday(&clk,(struct timezone *)NULL); // it takes
decode_delay = clk.tv_usec + 1000000*clk.tv_sec;
decode_delay -= target.tv_usec + 1000000*target.tv_sec;
- gettimeofday(&target,(timezone *)NULL); // Time a dither, to
+ gettimeofday(&target,(struct timezone *)NULL); // Time a dither, to
MajorWin.win->DisplayFrame(temp_frame,false); // find out how long
time_win->SetTime(Codec_stream->GetPos_hms(),false); // it takes
- gettimeofday(&clk,(timezone *)NULL);
+ gettimeofday(&clk,(struct timezone *)NULL);
dither_delay = clk.tv_usec + 1000000*clk.tv_sec;
dither_delay -= target.tv_usec + 1000000*target.tv_sec;
@@ -3268,9 +3270,9 @@
for(int a=0; a<5; a++)
{
- gettimeofday(&target,(timezone *)NULL); // Time usleep, to
+ gettimeofday(&target,(struct timezone *)NULL); // Time usleep, to
usleep(10000); // find out how long
- gettimeofday(&clk,(timezone *)NULL); // it takes
+ gettimeofday(&clk,(struct timezone *)NULL); // it takes
usleep_delay += clk.tv_usec + 1000000*clk.tv_sec - 10000;
usleep_delay -= target.tv_usec + 1000000*target.tv_sec;
@@ -3283,7 +3285,7 @@
// Calculate when the frame _should_ finish
- gettimeofday(&target,(timezone *)NULL);
+ gettimeofday(&target,(struct timezone *)NULL);
target.tv_usec += usec_per_frame - dither_delay - decode_delay;
if(target.tv_usec >= 1000000)
{
@@ -3299,7 +3301,7 @@
// See if we're ahead by more than a decode delay (for the next frame)
- gettimeofday(&clk,(timezone *)NULL);
+ gettimeofday(&clk,(struct timezone *)NULL);
diff = target.tv_usec - clk.tv_usec;
diff += 1000000*(target.tv_sec - clk.tv_sec);
if(diff>usleep_delay) // If we are ahead, sleep for a while
|