[vlc-devel] commit: rtp sout: support IPv6 in SDP for RTSP (Pierre Ynard )
git version control
git at videolan.org
Sat Jan 23 17:07:37 CET 2010
vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Jan 23 17:06:55 2010 +0100| [167c59f6c0def1770409e149ed9aff622d7c82f1] | committer: Pierre Ynard
rtp sout: support IPv6 in SDP for RTSP
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=167c59f6c0def1770409e149ed9aff622d7c82f1
---
modules/stream_out/rtp.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index a6b4fd6..fc29d74 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -763,13 +763,18 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
{
inclport = 0;
+ /* Check against URL format rtsp://[<ipv6>]:<port>/<path> */
+ bool ipv6 = rtsp_url != NULL && strlen( rtsp_url ) > 7
+ && rtsp_url[7] == '[';
+
/* Dummy destination address for RTSP */
- memset (&dst, 0, sizeof( struct sockaddr_in ) );
- dst.ss_family = AF_INET;
+ dstlen = ipv6 ? sizeof( struct sockaddr_in6 )
+ : sizeof( struct sockaddr_in );
+ memset (&dst, 0, dstlen);
+ dst.ss_family = ipv6 ? AF_INET6 : AF_INET;
#ifdef HAVE_SA_LEN
- dst.ss_len =
+ dst.ss_len = dstlen;
#endif
- dstlen = sizeof( struct sockaddr_in );
}
psz_sdp = vlc_sdp_Start( VLC_OBJECT( p_stream ), SOUT_CFG_PREFIX,
More information about the vlc-devel
mailing list