From 03c04ea6a44c5c989b64154adfafe8e60fc29f5d Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Mon, 5 Mar 2018 10:41:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwindows=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/MediaSource.cpp | 7 +++---- src/Common/MediaSource.h | 2 -- src/Rtsp/RtpBroadCaster.cpp | 5 ++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Common/MediaSource.cpp b/src/Common/MediaSource.cpp index 4f3355b7..caa3013e 100644 --- a/src/Common/MediaSource.cpp +++ b/src/Common/MediaSource.cpp @@ -29,11 +29,12 @@ #include "MediaFile/MediaReader.h" #include "Util/util.h" #include "Rtsp/Rtsp.h" +#include "Network/sockutil.h" using namespace ZL::Util; +using namespace ZL::Network; using namespace ZL::MediaFile; - namespace ZL { namespace Media { @@ -165,13 +166,11 @@ void MediaInfo::parse(const string &url){ //无效vhost m_vhost = DEFAULT_VHOST; }else{ - struct in_addr addr; - if(0 != inet_aton(m_vhost.data(),&addr)){ + if(INADDR_NONE != inet_addr(m_vhost.data())){ //这是ip,未指定vhost;使用默认vhost m_vhost = DEFAULT_VHOST; } } - } diff --git a/src/Common/MediaSource.h b/src/Common/MediaSource.h index e2bd3975..eb5421a1 100644 --- a/src/Common/MediaSource.h +++ b/src/Common/MediaSource.h @@ -38,8 +38,6 @@ #include "Util/TimeTicker.h" #include "Util/NoticeCenter.h" #include "Rtsp/Rtsp.h" -#include - using namespace std; using namespace Config; diff --git a/src/Rtsp/RtpBroadCaster.cpp b/src/Rtsp/RtpBroadCaster.cpp index 05d266d6..ef831f6b 100644 --- a/src/Rtsp/RtpBroadCaster.cpp +++ b/src/Rtsp/RtpBroadCaster.cpp @@ -26,13 +26,13 @@ #include #include -#include #include "RtpBroadCaster.h" #include "Util/util.h" #include "Network/sockutil.h" #include "RtspSession.h" using namespace std; +using namespace ZL::Network; namespace ZL { namespace Rtsp { @@ -40,8 +40,7 @@ namespace Rtsp { static uint32_t addressToInt(const string &ip){ struct in_addr addr; bzero(&addr,sizeof(addr)); - - inet_aton(ip.data(),&addr); + addr.s_addr = inet_addr(ip.data()); return (uint32_t)ntohl((uint32_t &)addr.s_addr); }