winlin

for #381, refine the hls notify, report one by one.

... ... @@ -794,6 +794,7 @@ vhost hooks.callback.srs.com {
# [stream], replace with the stream.
# [ts_url], replace with the ts url.
# ignore any return data of server.
# @remark random select a url to report, not report all.
on_hls_notify http://127.0.0.1:8085/api/v1/hls/[app]/[stream][ts_url];
}
}
... ...
... ... @@ -240,13 +240,17 @@ int SrsDvrAsyncCallOnHlsNotify::call()
return ret;
}
std::string url;
if (true) {
static u_int32_t nb_call = 0;
int index = nb_call++ % on_hls->args.size();
url = on_hls->args.at(index);
}
int nb_notify = _srs_config->get_vhost_hls_nb_notify(req->vhost);
for (int i = 0; i < (int)on_hls->args.size(); i++) {
std::string url = on_hls->args.at(i);
if ((ret = SrsHttpHooks::on_hls_notify(url, req, ts_url, nb_notify)) != ERROR_SUCCESS) {
srs_error("hook client on_hls_notify failed. url=%s, ts=%s, ret=%d", url.c_str(), ts_url.c_str(), ret);
return ret;
}
if ((ret = SrsHttpHooks::on_hls_notify(url, req, ts_url, nb_notify)) != ERROR_SUCCESS) {
srs_error("hook client on_hls_notify failed. url=%s, ts=%s, ret=%d", url.c_str(), ts_url.c_str(), ret);
return ret;
}
}
#endif
... ...