1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix #458, http hooks use source thread cid. 2.0.188

This commit is contained in:
winlin 2015-09-14 13:47:25 +08:00
parent 6d50aa1aa2
commit 0d57ef9373
8 changed files with 50 additions and 37 deletions

View file

@ -257,11 +257,11 @@ void SrsHttpHooks::on_stop(string url, SrsRequest* req)
return;
}
int SrsHttpHooks::on_dvr(string url, SrsRequest* req, string file)
int SrsHttpHooks::on_dvr(int cid, string url, SrsRequest* req, string file)
{
int ret = ERROR_SUCCESS;
int client_id = _srs_context->get_id();
int client_id = cid;
std::string cwd = _srs_config->cwd();
std::stringstream ss;
@ -293,11 +293,11 @@ int SrsHttpHooks::on_dvr(string url, SrsRequest* req, string file)
return ret;
}
int SrsHttpHooks::on_hls(string url, SrsRequest* req, string file, string ts_url, string m3u8, string m3u8_url, int sn, double duration)
int SrsHttpHooks::on_hls(int cid, string url, SrsRequest* req, string file, string ts_url, string m3u8, string m3u8_url, int sn, double duration)
{
int ret = ERROR_SUCCESS;
int client_id = _srs_context->get_id();
int client_id = cid;
std::string cwd = _srs_config->cwd();
std::stringstream ss;
@ -334,11 +334,11 @@ int SrsHttpHooks::on_hls(string url, SrsRequest* req, string file, string ts_url
return ret;
}
int SrsHttpHooks::on_hls_notify(std::string url, SrsRequest* req, std::string ts_url, int nb_notify)
int SrsHttpHooks::on_hls_notify(int cid, std::string url, SrsRequest* req, std::string ts_url, int nb_notify)
{
int ret = ERROR_SUCCESS;
int client_id = _srs_context->get_id();
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://")) {