From ede66ad78a3c06557c53b2c0b6ee014aa3418e03 Mon Sep 17 00:00:00 2001 From: Martin Peach Date: Wed, 11 Jul 2007 17:34:38 +0000 Subject: unpackOSC now simply outputs (through the right outlet) a delay in milliseconds when it receives a timetag, as the timetag itself is not useable inside pd. The delay is zero when the timetag is in the past. Help patches have been updated to match. Also corrected a mistake in packOSC.c timetag calculation. svn path=/trunk/externals/mrpeach/; revision=8008 --- osc/packOSC.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'osc/packOSC.c') diff --git a/osc/packOSC.c b/osc/packOSC.c index f609d64..ce73277 100755 --- a/osc/packOSC.c +++ b/osc/packOSC.c @@ -1281,12 +1281,13 @@ static OSCTimeTag OSCTT_CurrentTimePlusOffset(uint4 offset) (unsigned) (tz.tz_dsttime ? 3600 : 0)+ (unsigned) offset/onemillion; /* Now get the fractional part. */ - tt.fraction = ((unsigned) tv.tv_usec + (unsigned)(offset%onemillion)) * (unsigned) TWO_TO_THE_32_OVER_ONE_MILLION; + tt.fraction = (unsigned) tv.tv_usec + (unsigned)(offset%onemillion); /* in usec */ if (tt.fraction > onemillion) { tt.fraction -= onemillion; tt.seconds++; } + tt.fraction *= (unsigned) TWO_TO_THE_32_OVER_ONE_MILLION; /* convert usec to 32-bit fraction of 1 sec */ return tt; } -- cgit v1.2.1