格式化与精简代码

This commit is contained in:
xiongziliang 2023-04-01 23:54:11 +08:00
parent 384c8677ea
commit 23f9a42f72
3 changed files with 8 additions and 8 deletions

View File

@ -537,7 +537,7 @@ void addStreamProxy(const string &vhost, const string &app, const string &stream
return; return;
} }
//添加拉流代理 //添加拉流代理
auto player = std::make_shared<PlayerProxy>(vhost, app, stream, option, retry_count >=0 ? retry_count : -1); auto player = std::make_shared<PlayerProxy>(vhost, app, stream, option, retry_count);
s_proxyMap[key] = player; s_proxyMap[key] = player;
//指定RTP over TCP(播放rtsp时有效) //指定RTP over TCP(播放rtsp时有效)
@ -952,7 +952,7 @@ void installWebApi() {
} }
//添加推流代理 //添加推流代理
PusherProxy::Ptr pusher(new PusherProxy(src, retry_count>=0 ? retry_count : -1)); auto pusher = std::make_shared<PusherProxy>(src, retry_count);
s_proxyPusherMap[key] = pusher; s_proxyPusherMap[key] = pusher;
//指定RTP over TCP(播放rtsp时有效) //指定RTP over TCP(播放rtsp时有效)

View File

@ -161,7 +161,7 @@ void do_http_hook(const string &url, const ArgsType &body, const function<void(c
GET_CONFIG(float, retry_delay, Hook::kRetryDelay); GET_CONFIG(float, retry_delay, Hook::kRetryDelay);
const_cast<ArgsType &>(body)["mediaServerId"] = mediaServerId; const_cast<ArgsType &>(body)["mediaServerId"] = mediaServerId;
HttpRequester::Ptr requester(new HttpRequester); auto requester = std::make_shared<HttpRequester>();
requester->setMethod("POST"); requester->setMethod("POST");
auto bodyStr = to_string(body); auto bodyStr = to_string(body);
requester->setBody(bodyStr); requester->setBody(bodyStr);

View File

@ -108,7 +108,7 @@ onceToken token1([](){
class CMD_main : public CMD { class CMD_main : public CMD {
public: public:
CMD_main() { CMD_main() {
_parser.reset(new OptionParser(nullptr)); _parser = std::make_shared<OptionParser>(nullptr);
#if !defined(_WIN32) #if !defined(_WIN32)
(*_parser) << Option('d',/*该选项简称,如果是\x00则说明无简称*/ (*_parser) << Option('d',/*该选项简称,如果是\x00则说明无简称*/