hls拉流新增支持mime类型 (#1476)

一些流服务器输出mime头有可能时audio/x-mpegurl, 所以这点的判断不能写的太死了.
This commit is contained in:
alexliyu7352 2022-03-12 09:36:28 +08:00 committed by GitHub
parent 2c63916973
commit b4241e12d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -172,7 +172,7 @@ void HlsPlayer::onResponseHeader(const string &status, const HttpClient::HttpHea
throw invalid_argument("bad http status code:" + status);
}
auto content_type = strToLower(const_cast<HttpClient::HttpHeader &>(headers)["Content-Type"]);
if (content_type.find("application/vnd.apple.mpegurl") != 0 && content_type.find("application/x-mpegurl") != 0) {
if (content_type.find("application/vnd.apple.mpegurl") != 0 && content_type.find("/x-mpegurl") == _StrPrinter::npos) {
WarnL << "may not a hls video: " << content_type << ", url: " << getUrl();
}
_m3u8.clear();