aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-10-08 11:58:47 +0000
committerMartin Storsjö <martin@martin.st>2010-10-08 11:58:47 +0000
commit6898677e54a48f90665053359126bd71c0ed4a85 (patch)
tree63214f4781c19e6df50ddac1620f6cc478530612
parent6ded3a0411d69e4039f655f8c76c4d8a36ab221b (diff)
downloadffmpeg-6898677e54a48f90665053359126bd71c0ed4a85.tar.gz
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
-rw-r--r--libavformat/sdp.c4
1 files changed, 3 insertions, 1 deletions
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);