mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix parse srs version bug
This commit is contained in:
parent
c849010fe2
commit
26c20db2b3
2 changed files with 12 additions and 8 deletions
1
trunk/.gitignore
vendored
1
trunk/.gitignore
vendored
|
@ -31,4 +31,5 @@
|
|||
/research/speex/
|
||||
/test/
|
||||
.DS_Store
|
||||
srs
|
||||
|
||||
|
|
|
@ -2176,16 +2176,19 @@ int SrsRtmpClient::connect_app(string app, string tcUrl, SrsRequest* r, bool dsu
|
|||
if ((prop = arr->ensure_property_number("srs_pid")) != NULL) {
|
||||
si->pid = (int)prop->to_number();
|
||||
}
|
||||
if ((prop = arr->ensure_property_number("srs_version")) != NULL) {
|
||||
if ((prop = arr->ensure_property_string("srs_version")) != NULL) {
|
||||
vector<string> versions = srs_string_split(prop->to_str(), ".");
|
||||
if (versions.size() > 3) {
|
||||
si->build = ::atoi(versions.at(3).c_str());
|
||||
} else if (versions.size() > 2) {
|
||||
si->revision = ::atoi(versions.at(2).c_str());
|
||||
} else if (versions.size() > 1) {
|
||||
si->minor = ::atoi(versions.at(1).c_str());
|
||||
} else if (versions.size() > 0) {
|
||||
if (versions.size() > 0) {
|
||||
si->major = ::atoi(versions.at(0).c_str());
|
||||
if (versions.size() > 1) {
|
||||
si->minor = ::atoi(versions.at(1).c_str());
|
||||
if (versions.size() > 2) {
|
||||
si->revision = ::atoi(versions.at(2).c_str());
|
||||
if (versions.size() > 3) {
|
||||
si->build = ::atoi(versions.at(3).c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue