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

fix bug #67: fix pithy print bug, stage must has a age. 0.9.98

This commit is contained in:
winlin 2014-05-14 14:35:29 +08:00
parent cbbf53f8f9
commit cf712b06bb
2 changed files with 5 additions and 5 deletions

View file

@ -38,7 +38,7 @@ SrsStageInfo::SrsStageInfo(int _stage_id)
{ {
stage_id = _stage_id; stage_id = _stage_id;
nb_clients = 0; nb_clients = 0;
_age = printed_age = 0; age = printed_age = 0;
update_print_time(); update_print_time();
@ -90,16 +90,16 @@ void SrsStageInfo::update_print_time()
void SrsStageInfo::elapse(int64_t diff) void SrsStageInfo::elapse(int64_t diff)
{ {
_age += diff; age += diff;
} }
bool SrsStageInfo::can_print() bool SrsStageInfo::can_print()
{ {
int64_t can_print_age = nb_clients * pithy_print_time_ms; int64_t can_print_age = nb_clients * pithy_print_time_ms;
bool can_print = _age >= can_print_age; bool can_print = age >= can_print_age;
if (can_print) { if (can_print) {
_age = 0; age = 0;
} }
return can_print; return can_print;

View file

@ -54,7 +54,7 @@ public:
int pithy_print_time_ms; int pithy_print_time_ms;
int nb_clients; int nb_clients;
public: public:
int64_t _age; int64_t age;
int64_t printed_age; int64_t printed_age;
public: public:
SrsStageInfo(int _stage_id); SrsStageInfo(int _stage_id);