fix key frame timer (#2662)

This commit is contained in:
Paul Wells
2024-04-18 01:24:45 -07:00
committed by GitHub
parent 0974f3d961
commit 483aafcfc0
+5 -3
View File
@@ -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:
}