fix key frame timer (#2662)
This commit is contained in:
@@ -627,12 +627,11 @@ func (d *DownTrack) keyFrameRequester() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
timer := time.NewTimer(math.MaxInt64)
|
timer := time.NewTimer(math.MaxInt64)
|
||||||
|
timer.Stop()
|
||||||
|
|
||||||
defer timer.Stop()
|
defer timer.Stop()
|
||||||
|
|
||||||
for !d.IsClosed() {
|
for !d.IsClosed() {
|
||||||
if !timer.Stop() {
|
|
||||||
<-timer.C
|
|
||||||
}
|
|
||||||
timer.Reset(getInterval())
|
timer.Reset(getInterval())
|
||||||
|
|
||||||
select {
|
select {
|
||||||
@@ -640,6 +639,9 @@ func (d *DownTrack) keyFrameRequester() {
|
|||||||
if !more {
|
if !more {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if !timer.Stop() {
|
||||||
|
<-timer.C
|
||||||
|
}
|
||||||
case <-timer.C:
|
case <-timer.C:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user