mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 04:22:00 -08:00
allow repeated PAUSE requests (#107)
This commit is contained in:
parent
4a87f4752a
commit
584d2c9494
1 changed files with 9 additions and 3 deletions
|
|
@ -855,8 +855,10 @@ func (c *Client) handleRequest(req *base.Request) error {
|
|||
|
||||
case base.PAUSE:
|
||||
err := c.checkState(map[state]struct{}{
|
||||
statePlay: {},
|
||||
stateRecord: {},
|
||||
statePrePlay: {},
|
||||
statePlay: {},
|
||||
statePreRecord: {},
|
||||
stateRecord: {},
|
||||
})
|
||||
if err != nil {
|
||||
c.writeResError(cseq, base.StatusBadRequest, err)
|
||||
|
|
@ -870,7 +872,11 @@ func (c *Client) handleRequest(req *base.Request) error {
|
|||
"Session": base.HeaderValue{sessionId},
|
||||
},
|
||||
})
|
||||
return errStateInitial
|
||||
|
||||
if c.state == statePlay || c.state == stateRecord {
|
||||
return errStateInitial
|
||||
}
|
||||
return nil
|
||||
|
||||
case base.TEARDOWN:
|
||||
// close connection silently
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue