mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-01 15:32:23 +08:00
Optimize the code
1. change param_strs to params 2. move params from MediaInfo to MediaTuple 3. passing MediaTuple as a parameter for some functions
This commit is contained in:
@@ -583,7 +583,7 @@ void MediaInfo::parse(const std::string &url_in){
|
||||
auto url = url_in;
|
||||
auto pos = url.find("?");
|
||||
if (pos != string::npos) {
|
||||
param_strs = url.substr(pos + 1);
|
||||
params = url.substr(pos + 1);
|
||||
url.erase(pos);
|
||||
}
|
||||
|
||||
@@ -616,9 +616,10 @@ void MediaInfo::parse(const std::string &url_in){
|
||||
stream = stream_id;
|
||||
}
|
||||
|
||||
auto params = Parser::parseArgs(param_strs);
|
||||
if (params.find(VHOST_KEY) != params.end()) {
|
||||
vhost = params[VHOST_KEY];
|
||||
auto kv = Parser::parseArgs(params);
|
||||
auto it = kv.find(VHOST_KEY);
|
||||
if (it != kv.end()) {
|
||||
vhost = it->second;
|
||||
}
|
||||
|
||||
GET_CONFIG(bool, enableVhost, General::kEnableVhost);
|
||||
|
||||
Reference in New Issue
Block a user