mirror of
https://github.com/aler9/gortsplib
synced 2025-10-16 04:00:46 +08:00
client: restore 32bit support
This commit is contained in:
@@ -217,7 +217,7 @@ type Client struct {
|
|||||||
udpReportTimer *time.Timer
|
udpReportTimer *time.Timer
|
||||||
checkStreamTimer *time.Timer
|
checkStreamTimer *time.Timer
|
||||||
checkStreamInitial bool
|
checkStreamInitial bool
|
||||||
tcpLastFrameTime int64
|
tcpLastFrameTime *int64
|
||||||
keepaliveTimer *time.Timer
|
keepaliveTimer *time.Timer
|
||||||
closeError error
|
closeError error
|
||||||
writerRunning bool
|
writerRunning bool
|
||||||
@@ -539,7 +539,7 @@ func (c *Client) run() {
|
|||||||
} else { // TCP
|
} else { // TCP
|
||||||
inTimeout := func() bool {
|
inTimeout := func() bool {
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
lft := time.Unix(atomic.LoadInt64(&c.tcpLastFrameTime), 0)
|
lft := time.Unix(atomic.LoadInt64(c.tcpLastFrameTime), 0)
|
||||||
return now.Sub(lft) >= c.ReadTimeout
|
return now.Sub(lft) >= c.ReadTimeout
|
||||||
}()
|
}()
|
||||||
if inTimeout {
|
if inTimeout {
|
||||||
@@ -710,7 +710,8 @@ func (c *Client) playRecordStart() {
|
|||||||
|
|
||||||
default: // TCP
|
default: // TCP
|
||||||
c.checkStreamTimer = time.NewTimer(c.checkStreamPeriod)
|
c.checkStreamTimer = time.NewTimer(c.checkStreamPeriod)
|
||||||
c.tcpLastFrameTime = time.Now().Unix()
|
v := time.Now().Unix()
|
||||||
|
c.tcpLastFrameTime = &v
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch *c.protocol {
|
switch *c.protocol {
|
||||||
@@ -748,7 +749,7 @@ func (c *Client) runReader() {
|
|||||||
if c.state == clientStatePlay {
|
if c.state == clientStatePlay {
|
||||||
processFunc = func(trackID int, isRTP bool, payload []byte) {
|
processFunc = func(trackID int, isRTP bool, payload []byte) {
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
atomic.StoreInt64(&c.tcpLastFrameTime, now.Unix())
|
atomic.StoreInt64(c.tcpLastFrameTime, now.Unix())
|
||||||
|
|
||||||
if isRTP {
|
if isRTP {
|
||||||
c.tracks[trackID].rtcpReceiver.ProcessPacketRTP(now, payload)
|
c.tracks[trackID].rtcpReceiver.ProcessPacketRTP(now, payload)
|
||||||
|
Reference in New Issue
Block a user