diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 19431b58..62ed3e00 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -67,6 +67,7 @@ import ( "reflect" "strconv" "strings" + "time" "unsafe" "github.com/chamaken/cgolmnl/inet" @@ -1186,7 +1187,8 @@ func C_HandShake(r *C.RTMP, FP9HandShake int32) int { clientbuf[0] = 0x03 // not encrypted // TODO: port rtmp_getTime - uptime = inet.Htonl(uint32(C.RTMP_GetTime())) + //uptime = inet.Htonl(uint32(C.RTMP_GetTime())) + uptime = inet.Htonl(uint32(C_RTMP_GetTime())) memmove(unsafe.Pointer(clientsig), unsafe.Pointer(&uptime), 4) memset(indxBytePtr(unsafe.Pointer(clientsig), 4), 0, 4) @@ -1243,6 +1245,12 @@ func C_HandShake(r *C.RTMP, FP9HandShake int32) int { return 1 } +// uint32_t RTMP_GetTime(); +// rtmp.c +156 +func C_RTMP_GetTime() int32 { + return int32(time.Now().UnixNano() / 1000000) +} + // int ReadN(RTMP* r, char* buffer, int n); // rtmp.c +1390 func C_ReadN(r *C.RTMP, buffer *byte, n int) int {