mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 19:31:53 +00:00
fix bug #67: fix pithy print bug, stage must has a age. 0.9.98
This commit is contained in:
parent
cbbf53f8f9
commit
cf712b06bb
2 changed files with 5 additions and 5 deletions
|
@ -38,7 +38,7 @@ SrsStageInfo::SrsStageInfo(int _stage_id)
|
|||
{
|
||||
stage_id = _stage_id;
|
||||
nb_clients = 0;
|
||||
_age = printed_age = 0;
|
||||
age = printed_age = 0;
|
||||
|
||||
update_print_time();
|
||||
|
||||
|
@ -90,16 +90,16 @@ void SrsStageInfo::update_print_time()
|
|||
|
||||
void SrsStageInfo::elapse(int64_t diff)
|
||||
{
|
||||
_age += diff;
|
||||
age += diff;
|
||||
}
|
||||
|
||||
bool SrsStageInfo::can_print()
|
||||
{
|
||||
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) {
|
||||
_age = 0;
|
||||
age = 0;
|
||||
}
|
||||
|
||||
return can_print;
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
int pithy_print_time_ms;
|
||||
int nb_clients;
|
||||
public:
|
||||
int64_t _age;
|
||||
int64_t age;
|
||||
int64_t printed_age;
|
||||
public:
|
||||
SrsStageInfo(int _stage_id);
|
||||
|
|
Loading…
Reference in a new issue