implement PAUSE

This commit is contained in:
aler9 2019-12-28 23:48:57 +01:00
parent c3e99ee583
commit b02a15b8df

View File

@ -383,6 +383,16 @@ func (c *rtspClient) run(wg sync.WaitGroup) {
c.state = "PLAY"
c.p.mutex.Unlock()
case "PAUSE":
if c.state != "PLAY" {
c.log("ERR: client is in state '%s'", c.state)
return
}
c.p.mutex.Lock()
c.state = "PRE_PLAY"
c.p.mutex.Unlock()
case "RECORD":
if c.state != "PRE_RECORD" {
c.log("ERR: client is in state '%s'", c.state)