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
This commit is contained in:
Martin Storsjö 2010-10-08 11:58:47 +00:00
parent 6ded3a0411
commit 6898677e54

View File

@ -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);