From c1b6df7bc750e6365735c387b22971be6c8d7262 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Wed, 29 May 2019 09:24:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=99=9A=E6=8B=9F=E4=B8=BB?= =?UTF-8?q?=E6=9C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/MediaSource.cpp | 5 +++++ src/MediaFile/Mp4Maker.cpp | 20 +++++--------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/Common/MediaSource.cpp b/src/Common/MediaSource.cpp index 0c48cfc3..3af134ca 100644 --- a/src/Common/MediaSource.cpp +++ b/src/Common/MediaSource.cpp @@ -239,6 +239,11 @@ void MediaInfo::parse(const string &url){ _vhost = DEFAULT_VHOST; } } + + if(_vhost == "localhost"){ + _vhost = DEFAULT_VHOST; + } + GET_CONFIG(bool,enableVhost,General::kEnableVhost); if(!enableVhost){ _vhost = DEFAULT_VHOST; diff --git a/src/MediaFile/Mp4Maker.cpp b/src/MediaFile/Mp4Maker.cpp index f156ef42..5b24afe5 100644 --- a/src/MediaFile/Mp4Maker.cpp +++ b/src/MediaFile/Mp4Maker.cpp @@ -155,22 +155,12 @@ void Mp4Maker::createFile() { _info.strFilePath = strFile; GET_CONFIG(string,appName,Record::kAppName); - GET_CONFIG(bool,enableVhost,General::kEnableVhost); - if(enableVhost){ - _info.strUrl = _info.strVhost + "/" - + appName + "/" - + _info.strAppName + "/" - + _info.strStreamId + "/" - + strDate + "/" - + strTime + ".mp4"; - }else{ - _info.strUrl = appName + "/" - + _info.strAppName + "/" - + _info.strStreamId + "/" - + strDate + "/" - + strTime + ".mp4"; - } + _info.strUrl = appName + "/" + + _info.strAppName + "/" + + _info.strStreamId + "/" + + strDate + "/" + + strTime + ".mp4"; //----record 业务逻辑----//