1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +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

@ -202,6 +202,7 @@ For previous versions, please read:
## V3 changes
* v3.0, 2020-10-14, Fix [#1987][bug #1987], Fix Kbps resample bug. 3.0.145
* <strong>v3.0, 2020-10-10, [3.0 release1(3.0.144)][r3.0r1] released. 122674 lines.</strong>
* v3.0, 2020-10-10, Fix [#1780][bug #1780], build fail on Ubuntu20(focal). 3.0.144
* v3.0, 2020-09-14, Prevent stop ingest for multiple times. 3.0.143
@ -1764,6 +1765,7 @@ Winlin
[bug #1619]: https://github.com/ossrs/srs/issues/1619
[bug #1629]: https://github.com/ossrs/srs/issues/1629
[bug #1780]: https://github.com/ossrs/srs/issues/1780
[bug #1987]: https://github.com/ossrs/srs/issues/1987
[bug #yyyyyyyyyyyyy]: https://github.com/ossrs/srs/issues/yyyyyyyyyyyyy
[bug #1631]: https://github.com/ossrs/srs/issues/1631

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()