aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpproto.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-16 23:11:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-09-16 23:43:13 +0200
commit474d858fd9551b45a17e1f3a4322de1a88e749b9 (patch)
tree65d057d2acc5246e8c6bfecb741961aad8a18f5d /libavformat/rtpproto.c
parent4b58349bc8ff2ff5dfbc9eef1e5856fd16e1f517 (diff)
downloadffmpeg-474d858fd9551b45a17e1f3a4322de1a88e749b9.tar.gz
Revert "avformat/rtpproto: fix strict aliasing violations with sockaddr"
It appears this breaks build with MSVC until someone who has MSVC setup has time to investigate and workaround/fix this, its better to revert so that build is not broken Thats even more so as the original commit only fixed a hypothetical issue This reverts commit e587a428d75d58e2e5a592efd7bff44e1d9294ee.
Diffstat (limited to 'libavformat/rtpproto.c')
-rw-r--r--libavformat/rtpproto.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c
index 62f77da289..a8cbd97708 100644
--- a/libavformat/rtpproto.c
+++ b/libavformat/rtpproto.c
@@ -130,26 +130,23 @@ static int compare_addr(const struct sockaddr_storage *a,
static int get_port(const struct sockaddr_storage *ss)
{
- sockaddr_union ssu = (sockaddr_union){.storage = *ss};
if (ss->ss_family == AF_INET)
- return ntohs(ssu.in.sin_port);
+ return ntohs(((const struct sockaddr_in *)ss)->sin_port);
#if HAVE_STRUCT_SOCKADDR_IN6
if (ss->ss_family == AF_INET6)
- return ntohs(ssu.in6.sin6_port);
+ return ntohs(((const struct sockaddr_in6 *)ss)->sin6_port);
#endif
return 0;
}
static void set_port(struct sockaddr_storage *ss, int port)
{
- sockaddr_union ssu = (sockaddr_union){.storage = *ss};
if (ss->ss_family == AF_INET)
- ssu.in.sin_port = htons(port);
+ ((struct sockaddr_in *)ss)->sin_port = htons(port);
#if HAVE_STRUCT_SOCKADDR_IN6
else if (ss->ss_family == AF_INET6)
- ssu.in6.sin6_port = htons(port);
+ ((struct sockaddr_in6 *)ss)->sin6_port = htons(port);
#endif
- *ss = ssu.storage;
}
static int rtp_check_source_lists(RTPContext *s, struct sockaddr_storage *source_addr_ptr)