[FFmpeg-devel] [PATCH] avformat/rtsp: fix getnameinfo() call on FreeBSD
Kevin Lo
kevlo at kevlo.org
Thu Nov 24 16:55:50 EET 2016
FreeBSD's socket calls require the sockaddr struct length to agree
with the address family, Linux does not. This patch fixes a failing
getnameinfo() call on FreeBSD.
Signed-off-by: Kevin Lo <kevlo at kevlo.org>
---
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c6292c5..15fe25d 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2310,7 +2310,11 @@ static int sdp_read_header(AVFormatContext *s)
AVDictionary *opts = map_to_opts(rt);
err = getnameinfo((struct sockaddr*) &rtsp_st->sdp_ip,
+#ifdef __FreeBSD__
+ ((struct sockaddr*) &rtsp_st->sdp_ip)->sa_len,
+#else
sizeof(rtsp_st->sdp_ip),
+#endif
namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST);
if (err) {
av_log(s, AV_LOG_ERROR, "getnameinfo: %s\n", gai_strerror(err));
More information about the ffmpeg-devel
mailing list