Skip to content

Commit 888691d

Browse files
committed
fix: support ffmpeg option '-rtsp_transport udp' while receiving
1 parent 55262b6 commit 888691d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

client.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,17 @@ func (c *client) handleRequest(req *rtsp.Request) bool {
375375
// play
376376
case "STARTING", "PRE_PLAY":
377377
// play via UDP
378-
if _, ok := th["RTP/AVP"]; ok {
378+
if func() bool {
379+
_, ok := th["RTP/AVP"]
380+
if ok {
381+
return true
382+
}
383+
_, ok = th["RTP/AVP/UDP"]
384+
if ok {
385+
return true
386+
}
387+
return false
388+
}() {
379389
rtpPort, rtcpPort := th.getClientPorts()
380390
if rtpPort == 0 || rtcpPort == 0 {
381391
c.writeResError(req, fmt.Errorf("transport header does not have valid client ports (%s)", transportstr))

0 commit comments

Comments
 (0)