diff options
author | Martin Peach <mrpeach@users.sourceforge.net> | 2007-09-01 16:39:26 +0000 |
---|---|---|
committer | Martin Peach <mrpeach@users.sourceforge.net> | 2007-09-01 16:39:26 +0000 |
commit | eb3669acd2586c3761f7cc48bab432ba843d5555 (patch) | |
tree | 467617fc12888486044c013c7bdf1cf8fc5d659e /osc | |
parent | 0d3baf9be42d1083de7473481bc3113114568d6d (diff) |
Removed timezone calculation from timestamp so timestamp is always UTC.
svn path=/trunk/externals/mrpeach/; revision=8697
Diffstat (limited to 'osc')
-rwxr-xr-x | osc/packOSC.c | 4 | ||||
-rwxr-xr-x | osc/unpackOSC.c | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/osc/packOSC.c b/osc/packOSC.c index 1a604a4..0849769 100755 --- a/osc/packOSC.c +++ b/osc/packOSC.c @@ -1290,9 +1290,7 @@ static OSCTimeTag OSCTT_CurrentTimePlusOffset(uint4 offset) /* First get the seconds right */ tt.seconds = (unsigned) SECONDS_FROM_1900_to_1970 + - (unsigned) tv.tv_sec - - (unsigned) 60 * tz.tz_minuteswest + - (unsigned) (tz.tz_dsttime ? 3600 : 0)+ + (unsigned) tv.tv_sec + (unsigned) offset/onemillion; /* Now get the fractional part. */ tt.fraction = (unsigned) tv.tv_usec + (unsigned)(offset%onemillion); /* in usec */ diff --git a/osc/unpackOSC.c b/osc/unpackOSC.c index c1ca36a..096ac0c 100755 --- a/osc/unpackOSC.c +++ b/osc/unpackOSC.c @@ -618,8 +618,7 @@ static t_float unpackOSC_DeltaTime(OSCTimeTag tt) _ftime(&tb); /* find now */ /* First get the seconds right */ - ttnow.seconds = (unsigned) SECONDS_FROM_1900_to_1970 + - (unsigned) tb.time; + ttnow.seconds = (unsigned) SECONDS_FROM_1900_to_1970 + (unsigned) tb.time; /* find usec in tt */ ttusec = tt.seconds*onemillion + ONE_MILLION_OVER_TWO_TO_THE_32*tt.fraction; nowusec = ttnow.seconds*onemillion + tb.millitm*onethousand; @@ -629,10 +628,7 @@ static t_float unpackOSC_DeltaTime(OSCTimeTag tt) gettimeofday(&tv, &tz); /* find now */ /* First get the seconds right */ - ttnow.seconds = (unsigned) SECONDS_FROM_1900_to_1970 + - (unsigned) tv.tv_sec - - (unsigned) 60 * tz.tz_minuteswest + - (unsigned) (tz.tz_dsttime ? 3600 : 0); + ttnow.seconds = (unsigned) SECONDS_FROM_1900_to_1970 + (unsigned) tv.tv_sec; /* find usec in tt */ ttusec = tt.seconds*onemillion + ONE_MILLION_OVER_TWO_TO_THE_32*tt.fraction; nowusec = ttnow.seconds*onemillion + tv.tv_usec; |