mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-14 12:05:58 +08:00
http地址支持相对路径 (#2223)
* 部分hls中会出现类似[../]或者[./]的相对地址, 因此写了一个解析的方法 * 有时候上游http协议不规范会导致直接输出eof, 特别是在自动重试机制开启下, 容易造成定时器没办法初始化从而拉不到流但是session一直存在,所以需要做一个判断,如果没数据直接报错
This commit is contained in:
@@ -37,15 +37,7 @@ bool HlsParser::parse(const string &http_url, const string &m3u8) {
|
||||
|
||||
if ((_is_m3u8_inner || extinf_dur != 0) && line[0] != '#') {
|
||||
segment.duration = extinf_dur;
|
||||
if (line.find("http://") == 0 || line.find("https://") == 0) {
|
||||
segment.url = line;
|
||||
} else {
|
||||
if (line.find("/") == 0) {
|
||||
segment.url = http_url.substr(0, http_url.find("/", 8)) + line;
|
||||
} else {
|
||||
segment.url = http_url.substr(0, http_url.rfind("/") + 1) + line;
|
||||
}
|
||||
}
|
||||
segment.url = Parser::merge_url(http_url, line);
|
||||
if (!_is_m3u8_inner) {
|
||||
//ts按照先后顺序排序
|
||||
ts_map.emplace(index++, segment);
|
||||
|
||||
Reference in New Issue
Block a user