mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
GB28181: 无法对接平台问题及一些小bug (#2109)
* 1-新增srs_string_split2函数,该函数支持空串也能按照原有顺序进行切分并放入数组 2-SrsGb28181Device增加属性字段,并在收到catalog命令时能够更新该属性 3-修复sip包解包不严谨bug(body中有可能会有SRS_RTSP_CRLFCRLF那么导致header_body[1]就不一定是body了可能只是body的一部分) * 1-修复停用rtp多路复用参数(invite_port_fixed)不起作用bug * bugfix: 当srs发送invite时会指定一个ssrc作为流媒体序列号,但有些平台发流时并不使用这个作为ssrc,而是自己新生成一个。(修复该bug是在invite response时解析内容中的sdp,把对方生成的流媒体序列号ssrc读出来,并且更新srs的channel映射) * Update push.gb28181.conf 恢复成原来的conf * bugfix,在取得muxer时需要更新。之前写反了 * Merge branch 'develop' into 4.0release * 解决冲突时,优先选择原有代码(还原选择develop的代码) * 解决冲突时,优先选择原有代码(还原选择develop的代码) * 解决冲突时,优先选择原有代码(还原选择develop的代码) * 解决冲突时,优先选择原有代码(还原选择develop的代码) * 修改sdp_map相同属性的连接符 * 解决冲突时,优先选择原有代码(还原选择develop的代码) * 修改sdp_map相同属性的连接符 * 解决冲突时,优先选择原有代码(还原选择develop的代码) * 解决冲突时,优先选择原有代码(还原选择develop的代码) * 回退原来代码 * 删除parse_sdp存储至map相关代码 * 格式恢复 * 格式恢复 * 恢复格式 * srs_string_split() 函数的bugfix Co-authored-by: xbpeng <xianbin.peng@sibat.cn>
This commit is contained in:
parent
6cf93557e1
commit
47422b7819
5 changed files with 45 additions and 62 deletions
|
@ -480,30 +480,24 @@ int srs_string_count(string str, string flag)
|
|||
return nn;
|
||||
}
|
||||
|
||||
vector<string> srs_string_split(string str, string flag)
|
||||
{
|
||||
vector<string> arr;
|
||||
|
||||
if (flag.empty()) {
|
||||
arr.push_back(str);
|
||||
return arr;
|
||||
|
||||
vector<string> srs_string_split(string s, string seperator) {
|
||||
vector<string> result;
|
||||
if(seperator.empty()){
|
||||
result.push_back(s);
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t pos;
|
||||
string s = str;
|
||||
|
||||
while ((pos = s.find(flag)) != string::npos) {
|
||||
if (pos != 0) {
|
||||
arr.push_back(s.substr(0, pos));
|
||||
}
|
||||
s = s.substr(pos + flag.length());
|
||||
size_t posBegin = 0;
|
||||
size_t posSeperator = s.find(seperator);
|
||||
while (posSeperator != string::npos) {
|
||||
result.push_back(s.substr(posBegin, posSeperator - posBegin));
|
||||
posBegin = posSeperator + seperator.length(); // next byte of seperator
|
||||
posSeperator = s.find(seperator, posBegin);
|
||||
}
|
||||
|
||||
if (!s.empty()) {
|
||||
arr.push_back(s);
|
||||
}
|
||||
|
||||
return arr;
|
||||
// push the last element
|
||||
result.push_back(s.substr(posBegin));
|
||||
return result;
|
||||
}
|
||||
|
||||
string srs_string_min_match(string str, vector<string> flags)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue