优化函数命名风格

FindField改名为findSubString
This commit is contained in:
xia-chu
2023-06-10 12:28:49 +08:00
committed by 夏楚
parent 31944a92ad
commit 64b8079ac1
17 changed files with 51 additions and 50 deletions

View File

@@ -52,14 +52,14 @@ void RtmpPlayer::teardown() {
void RtmpPlayer::play(const string &url) {
teardown();
string host_url = FindField(url.data(), "://", "/");
string host_url = findSubString(url.data(), "://", "/");
{
auto pos = url.find_last_of('/');
if (pos != string::npos) {
_stream_id = url.substr(pos + 1);
}
}
_app = FindField(url.data(), (host_url + "/").data(), ("/" + _stream_id).data());
_app = findSubString(url.data(), (host_url + "/").data(), ("/" + _stream_id).data());
_tc_url = string("rtmp://") + host_url + "/" + _app;
if (!_app.size() || !_stream_id.size()) {