Fix 400 response on PLAY for Reolink Doorbell #562

This commit is contained in:
Alexey Khit
2023-08-23 06:52:33 +03:00
parent 20efe22e60
commit 71f1e445e1
3 changed files with 12 additions and 3 deletions
+6 -2
View File
@@ -86,7 +86,7 @@ func (c *Conn) packetWriter(codec *core.Codec, channel, payloadType uint8) core.
}
handlerFunc := func(packet *rtp.Packet) {
if c.state == StateNone {
if c.state == StateNone || !c.playOK {
return
}
@@ -102,6 +102,10 @@ func (c *Conn) packetWriter(codec *core.Codec, channel, payloadType uint8) core.
Payload: packet.Payload,
}
if !video {
packet.Marker = true // better to have marker on all audio packets
}
size := 12 + len(packet.Payload)
if n+4+size > len(buf) {
@@ -130,7 +134,7 @@ func (c *Conn) packetWriter(codec *core.Codec, channel, payloadType uint8) core.
n += 4 + size
if video && !packet.Marker {
if !packet.Marker {
return // collect continious video packets to buffer
}