mirror of
https://github.com/livekit/livekit.git
synced 2026-10-22 21:53:22 +00:00
fix key frame timer (#2662)
This commit is contained in:
1 parent
0974f3d961
commit
483aafcfc0
1 file changed
+5
-3
@@ -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