server: use timers only when needed

This commit is contained in:
aler9
2021-11-15 12:20:04 +01:00
parent b81267e310
commit 1a599b1400
3 changed files with 35 additions and 26 deletions

11
emptytimer.go Normal file
View File

@@ -0,0 +1,11 @@
package gortsplib
import (
"time"
)
func emptyTimer() *time.Timer {
t := time.NewTimer(0)
<-t.C
return t
}