Browse Source

implement PAUSE

pull/2/head
aler9 5 years ago
parent
commit
b02a15b8df
  1. 10
      rtsp_client.go

10
rtsp_client.go

@ -383,6 +383,16 @@ func (c *rtspClient) run(wg sync.WaitGroup) { @@ -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)

Loading…
Cancel
Save