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

Refactor code, use pithy print for RTC send.

This commit is contained in:
winlin 2020-04-10 17:42:54 +08:00
parent 94afe6c56e
commit 928d863e50
3 changed files with 13 additions and 5 deletions

View file

@ -1398,12 +1398,12 @@ srs_error_t SrsRtcServer::cycle()
{
srs_error_t err = srs_success;
// TODO: FIXME: Use pithy print.
uint32_t cnt = 1;
uint64_t nn_msgs = 0;
SrsStatistic* stat = SrsStatistic::instance();
SrsPithyPrint* pprint = SrsPithyPrint::create_rtc_send();
SrsAutoFree(SrsPithyPrint, pprint);
// TODO: FIXME: Support reload.
int max_sendmmsg = _srs_config->get_rtc_server_sendmmsg();
@ -1439,8 +1439,8 @@ srs_error_t SrsRtcServer::cycle()
// Increase total messages.
nn_msgs += pos;
// TODO: FIXME: Use pithy print.
if ((cnt++ % 100) == 0) {
pprint->elapse();
if (pprint->can_print()) {
// TODO: FIXME: Support reload.
max_sendmmsg = _srs_config->get_rtc_server_sendmmsg();
srs_trace("-> RTC SEND %d by sendmmsg %d, total %" PRId64 " msgs", pos, max_sendmmsg, nn_msgs);