From 310157ab77f64e4874b4712ae768890c029bb646 Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 10 Apr 2015 12:30:22 +0800 Subject: [PATCH] refine the hls_on_notify, calc the spent time in ms. --- trunk/src/app/srs_app_http_hooks.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trunk/src/app/srs_app_http_hooks.cpp b/trunk/src/app/srs_app_http_hooks.cpp index cc814d4b7..59a83ccc6 100644 --- a/trunk/src/app/srs_app_http_hooks.cpp +++ b/trunk/src/app/srs_app_http_hooks.cpp @@ -341,6 +341,8 @@ int SrsHttpHooks::on_hls_notify(std::string url, SrsRequest* req, std::string ts url = srs_string_replace(url, "[stream]", req->stream); url = srs_string_replace(url, "[ts_url]", ts_url); + int64_t starttime = srs_update_system_time_ms(); + SrsHttpUri uri; if ((ret = uri.initialize(url)) != ERROR_SUCCESS) { srs_error("http: post failed. url=%s, ret=%d", url.c_str(), ret); @@ -366,8 +368,9 @@ int SrsHttpHooks::on_hls_notify(std::string url, SrsRequest* req, std::string ts break; } - srs_trace("http hook on_hls_notify success. client_id=%d, url=%s, code=%d, ret=%d", - client_id, url.c_str(), msg->status_code(), ret); + int spenttime = (int)(srs_update_system_time_ms() - starttime); + srs_trace("http hook on_hls_notify success. client_id=%d, url=%s, code=%d, spent=%dms, ret=%d", + client_id, url.c_str(), msg->status_code(), spenttime, ret); // ignore any error for on_hls_notify. ret = ERROR_SUCCESS;