Line 0
Link Here
|
|
|
1 |
--- libavformat/rtsp.c.orig 2016-11-26 17:12:14 UTC |
2 |
+++ libavformat/rtsp.c |
3 |
@@ -1598,7 +1598,12 @@ int ff_rtsp_make_setup_request(AVFormatC |
4 |
} |
5 |
if (ttl > 0) |
6 |
snprintf(optbuf, sizeof(optbuf), "?ttl=%d", ttl); |
7 |
- getnameinfo((struct sockaddr*) &addr, sizeof(addr), |
8 |
+ getnameinfo((struct sockaddr*) &addr, |
9 |
+#if HAVE_STRUCT_SOCKADDR_SA_LEN |
10 |
+ ((struct sockaddr*) &addr)->sa_len, |
11 |
+#else |
12 |
+ sizeof(addr), |
13 |
+#endif |
14 |
namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST); |
15 |
ff_url_join(url, sizeof(url), "rtp", NULL, namebuf, |
16 |
port, "%s", optbuf); |
17 |
@@ -1806,8 +1811,13 @@ redirect: |
18 |
goto fail; |
19 |
} |
20 |
if (!getpeername(tcp_fd, (struct sockaddr*) &peer, &peer_len)) { |
21 |
- getnameinfo((struct sockaddr*) &peer, peer_len, host, sizeof(host), |
22 |
- NULL, 0, NI_NUMERICHOST); |
23 |
+ getnameinfo((struct sockaddr*) &peer, |
24 |
+#if HAVE_STRUCT_SOCKADDR_SA_LEN |
25 |
+ ((struct sockaddr*) &peer)->sa_len, |
26 |
+#else |
27 |
+ peer_len, |
28 |
+#endif |
29 |
+ host, sizeof(host), NULL, 0, NI_NUMERICHOST); |
30 |
} |
31 |
|
32 |
/* request options supported by the server; this also detects server |
33 |
@@ -2283,7 +2293,12 @@ static int sdp_read_header(AVFormatConte |
34 |
if (!(rt->rtsp_flags & RTSP_FLAG_CUSTOM_IO)) { |
35 |
AVDictionary *opts = map_to_opts(rt); |
36 |
|
37 |
- getnameinfo((struct sockaddr*) &rtsp_st->sdp_ip, sizeof(rtsp_st->sdp_ip), |
38 |
+ getnameinfo((struct sockaddr*) &rtsp_st->sdp_ip, |
39 |
+#if HAVE_STRUCT_SOCKADDR_SA_LEN |
40 |
+ ((struct sockaddr*) &rtsp_st->sdp_ip)->sa_len, |
41 |
+#else |
42 |
+ sizeof(rtsp_st->sdp_ip), |
43 |
+#endif |
44 |
namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST); |
45 |
ff_url_join(url, sizeof(url), "rtp", NULL, |
46 |
namebuf, rtsp_st->sdp_port, |