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

Refactor: Use compositor for ISrsKbpsDelta. v5.0.51

This commit is contained in:
winlin 2022-08-30 07:46:12 +08:00
parent 29ae29c693
commit 1630918b0f
24 changed files with 225 additions and 213 deletions

View file

@ -478,11 +478,12 @@ void SrsStatistic::cleanup_stream(SrsStatisticStream* stream)
void SrsStatistic::kbps_add_delta(std::string id, ISrsKbpsDelta* delta)
{
if (clients.find(id) == clients.end()) {
return;
}
SrsStatisticClient* client = clients[id];
if (!delta) return;
map<string, SrsStatisticClient*>::iterator it = clients.find(id);
if (it == clients.end()) return;
SrsStatisticClient* client = it->second;
// resample the kbps to collect the delta.
int64_t in, out;