From eb3669acd2586c3761f7cc48bab432ba843d5555 Mon Sep 17 00:00:00 2001 From: Martin Peach Date: Sat, 1 Sep 2007 16:39:26 +0000 Subject: Removed timezone calculation from timestamp so timestamp is always UTC. svn path=/trunk/externals/mrpeach/; revision=8697 --- osc/packOSC.c | 4 +--- 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; -- cgit v1.2.1