mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-05 02:38:10 +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);
|
||||
|
||||
@@ -299,7 +299,6 @@ public:
|
||||
std::string full_url;
|
||||
std::string schema;
|
||||
std::string host;
|
||||
std::string param_strs;
|
||||
};
|
||||
|
||||
bool equalMediaTuple(const MediaTuple& a, const MediaTuple& b);
|
||||
|
||||
Reference in New Issue
Block a user