mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix the on_hls.ts_url bug.
This commit is contained in:
parent
34d1ce9922
commit
2830ee12c1
7 changed files with 60 additions and 3 deletions
|
@ -38,6 +38,7 @@ using namespace std;
|
|||
#include <srs_app_config.hpp>
|
||||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_app_http_conn.hpp>
|
||||
#include <srs_app_utility.hpp>
|
||||
|
||||
#define SRS_HTTP_RESPONSE_OK SRS_XSTR(ERROR_SUCCESS)
|
||||
|
||||
|
@ -300,6 +301,12 @@ int SrsHttpHooks::on_hls(int cid, string url, SrsRequest* req, string file, stri
|
|||
int client_id = cid;
|
||||
std::string cwd = _srs_config->cwd();
|
||||
|
||||
// the ts_url is under the same dir of m3u8_url.
|
||||
string prefix = srs_path_dirname(m3u8_url);
|
||||
if (!prefix.empty() && !srs_string_is_http(ts_url)) {
|
||||
ts_url = prefix + "/" + ts_url;
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
ss << SRS_JOBJECT_START
|
||||
<< SRS_JFIELD_STR("action", "on_hls") << SRS_JFIELD_CONT
|
||||
|
@ -341,7 +348,7 @@ int SrsHttpHooks::on_hls_notify(int cid, std::string url, SrsRequest* req, std::
|
|||
int client_id = cid;
|
||||
std::string cwd = _srs_config->cwd();
|
||||
|
||||
if (srs_string_starts_with(ts_url, "http://") || srs_string_starts_with(ts_url, "https://")) {
|
||||
if (srs_string_is_http(ts_url)) {
|
||||
url = ts_url;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue