Skip to content

Commit cd95969

Browse files
committed
fix: avoid int64 conversion on sdp
1 parent ae44875 commit cd95969

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

media/sdp/utils.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import (
1111
)
1212

1313
func GetCurrentNTPTimestamp() uint64 {
14-
ntpEpochOffset := 2208988800 // Offset from Unix epoch (January 1, 1970) to NTP epoch (January 1, 1900)
14+
var ntpEpochOffset int64 = 2208988800 // Offset from Unix epoch (January 1, 1970) to NTP epoch (January 1, 1900)
1515
currentTime := time.Now().Unix() + int64(ntpEpochOffset)
1616

1717
return uint64(currentTime)
1818
}
1919

2020
func NTPTimestamp(now time.Time) uint64 {
21-
ntpEpochOffset := 2208988800 // Offset from Unix epoch (January 1, 1970) to NTP epoch (January 1, 1900)
22-
currentTime := now.Unix() + int64(ntpEpochOffset)
21+
var ntpEpochOffset int64 = 2208988800 // Offset from Unix epoch (January 1, 1970) to NTP epoch (January 1, 1900)
22+
currentTime := now.Unix() + ntpEpochOffset
2323

2424
return uint64(currentTime)
2525
}

0 commit comments

Comments
 (0)