mirror of
https://github.com/livekit/livekit.git
synced 2026-08-29 09:49:24 +00:00
fix key frame timer (#2662)
This commit is contained in:
@@ -627,12 +627,11 @@ func (d *DownTrack) keyFrameRequester() {
|
||||
}
|
||||
|
||||
timer := time.NewTimer(math.MaxInt64)
|
||||
timer.Stop()
|
||||
|
||||
defer timer.Stop()
|
||||
|
||||
for !d.IsClosed() {
|
||||
if !timer.Stop() {
|
||||
<-timer.C
|
||||
}
|
||||
timer.Reset(getInterval())
|
||||
|
||||
select {
|
||||
@@ -640,6 +639,9 @@ func (d *DownTrack) keyFrameRequester() {
|
||||
if !more {
|
||||
return
|
||||
}
|
||||
if !timer.Stop() {
|
||||
<-timer.C
|
||||
}
|
||||
case <-timer.C:
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user