[vlc-devel] [PATCH] sout/rtsp: fix SETUP error

Zhao Zhili quinkblack at foxmail.com
Tue Dec 5 07:28:25 CET 2017


According to RFC 2326:
   port:
          This parameter provides the RTP/RTCP port pair for a multicast
          session. It is specified as a range, e.g., port=3456-3457.

And there is an example in section 14.5:
     C->M: SETUP rtsp://server.example.com/demo/548/sound RTSP/1.0
           CSeq: 2
           Transport: RTP/AVP;multicast;destination=225.219.201.15;
                      port=7000-7001;ttl=127
           Conference: 199702170042.SAA08642 at obiwan.arl.wustl.edu%20Starr
---
 modules/stream_out/rtsp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c
index 35ee7e7..26fa61e 100644
--- a/modules/stream_out/rtsp.c
+++ b/modules/stream_out/rtsp.c
@@ -728,6 +728,9 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
                     if( strncmp( opt, "unicast", 7 ) == 0 )
                         b_multicast = false;
                     else
+                    if( sscanf( opt, "port=%u-%u", &loport, &hiport ) == 2 )
+                            ;
+                    else
                     if( sscanf( opt, "client_port=%u-%u", &loport, &hiport )
                                 == 2 )
                         ;
-- 
2.7.4





More information about the vlc-devel mailing list