mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine the order.
This commit is contained in:
parent
7b2b11e932
commit
1fd83d9314
30 changed files with 985 additions and 751 deletions
|
@ -487,6 +487,36 @@ SrsJsonAny* SrsJsonObject::ensure_property_boolean(string name)
|
|||
return prop;
|
||||
}
|
||||
|
||||
SrsJsonAny* SrsJsonObject::ensure_property_object(string name)
|
||||
{
|
||||
SrsJsonAny* prop = get_property(name);
|
||||
|
||||
if (!prop) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!prop->is_object()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return prop;
|
||||
}
|
||||
|
||||
SrsJsonAny* SrsJsonObject::ensure_property_array(string name)
|
||||
{
|
||||
SrsJsonAny* prop = get_property(name);
|
||||
|
||||
if (!prop) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!prop->is_array()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return prop;
|
||||
}
|
||||
|
||||
SrsJsonArray::SrsJsonArray()
|
||||
{
|
||||
marker = SRS_JSON_Array;
|
||||
|
|
|
@ -151,6 +151,8 @@ public:
|
|||
virtual SrsJsonAny* ensure_property_string(std::string name);
|
||||
virtual SrsJsonAny* ensure_property_integer(std::string name);
|
||||
virtual SrsJsonAny* ensure_property_boolean(std::string name);
|
||||
virtual SrsJsonAny* ensure_property_object(std::string name);
|
||||
virtual SrsJsonAny* ensure_property_array(std::string name);
|
||||
};
|
||||
|
||||
class SrsJsonArray : public SrsJsonAny
|
||||
|
|
|
@ -67,8 +67,13 @@ void srs_discovery_tc_url(
|
|||
host = host.substr(0, pos);
|
||||
srs_info("discovery host=%s, port=%s", host.c_str(), port.c_str());
|
||||
}
|
||||
|
||||
app = url;
|
||||
|
||||
if (url.empty()) {
|
||||
app = SRS_CONSTS_RTMP_DEFAULT_APP;
|
||||
} else {
|
||||
app = url;
|
||||
}
|
||||
|
||||
vhost = host;
|
||||
srs_vhost_resolve(vhost, app, param);
|
||||
}
|
||||
|
@ -230,7 +235,7 @@ std::string srs_generate_stream_url(std::string vhost, std::string app, std::str
|
|||
std::string url = "";
|
||||
|
||||
if (SRS_CONSTS_RTMP_DEFAULT_VHOST != vhost){
|
||||
url += vhost;
|
||||
url += vhost;
|
||||
}
|
||||
url += "/";
|
||||
url += app;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue