diff --git a/libmpdemux/network.c b/libmpdemux/network.c index c6f920d554..4040e2aa37 100644 --- a/libmpdemux/network.c +++ b/libmpdemux/network.c @@ -199,7 +199,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { return -2; } - memcpy( our_s_addr, (void*)hp->h_addr, hp->h_length ); + memcpy( our_s_addr, (void*)hp->h_addr_list[0], hp->h_length ); } #ifdef HAVE_WINSOCK2 else { diff --git a/libmpdemux/rtp.c b/libmpdemux/rtp.c index ec73952e97..d2a5612c0b 100644 --- a/libmpdemux/rtp.c +++ b/libmpdemux/rtp.c @@ -78,7 +78,7 @@ static int rtp_open_socket( URL_t *url ) { mp_msg(MSGT_NETWORK,MSGL_ERR,"Counldn't resolve name: %s\n", url->hostname); goto err_out; } - memcpy( (void*)&server_address.sin_addr.s_addr, (void*)hp->h_addr, hp->h_length ); + memcpy( (void*)&server_address.sin_addr.s_addr, (void*)hp->h_addr_list[0], hp->h_length ); #else server_address.sin_addr.s_addr = htonl(INADDR_ANY); #endif