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

Merge branch '4.0release' into develop

This commit is contained in:
winlin 2020-10-14 11:39:45 +08:00
commit bce55d2789
3 changed files with 9 additions and 5 deletions

View file

@ -24,6 +24,6 @@
#ifndef SRS_CORE_VERSION3_HPP
#define SRS_CORE_VERSION3_HPP
#define SRS_VERSION3_REVISION 144
#define SRS_VERSION3_REVISION 145
#endif

View file

@ -166,22 +166,24 @@ void SrsKbps::set_io(ISrsProtocolStatistic* in, ISrsProtocolStatistic* out)
int SrsKbps::get_send_kbps()
{
srs_utime_t duration = clk->now() - is.starttime;
int duration = srsu2ms(clk->now() - is.starttime);
if (duration <= 0) {
return 0;
}
int64_t bytes = get_send_bytes();
return (int)(bytes * 8 / srsu2ms(duration));
return (int)(bytes * 8 / duration);
}
int SrsKbps::get_recv_kbps()
{
srs_utime_t duration = clk->now() - os.starttime;
int duration = srsu2ms(clk->now() - os.starttime);
if (duration <= 0) {
return 0;
}
int64_t bytes = get_recv_bytes();
return (int)(bytes * 8 / srsu2ms(duration));
return (int)(bytes * 8 / duration);
}
int SrsKbps::get_send_kbps_30s()