From 6898677e54a48f90665053359126bd71c0ed4a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 Oct 2010 11:58:47 +0000 Subject: [PATCH] sdp: Only specify the TTL for IPv4 addresses According to RFC 4566, a TTL value must not be present for IPv6 multicast. Originally committed as revision 25412 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/sdp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 3ea31efc32..63169a929d 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -56,7 +56,9 @@ static void sdp_write_address(char *buff, int size, const char *dest_addr, if (dest_addr) { if (!dest_type) dest_type = "IP4"; - if (ttl > 0) { + if (ttl > 0 && !strcmp(dest_type, "IP4")) { + /* The TTL should only be specified for IPv4 multicast addresses, + * not for IPv6. */ av_strlcatf(buff, size, "c=IN %s %s/%d\r\n", dest_type, dest_addr, ttl); } else { av_strlcatf(buff, size, "c=IN %s %s\r\n", dest_type, dest_addr);