fix bug #67: fix pithy print bug, stage must has a age. 0.9.98
正在显示
2 个修改的文件
包含
5 行增加
和
5 行删除
@@ -38,7 +38,7 @@ SrsStageInfo::SrsStageInfo(int _stage_id) | @@ -38,7 +38,7 @@ SrsStageInfo::SrsStageInfo(int _stage_id) | ||
38 | { | 38 | { |
39 | stage_id = _stage_id; | 39 | stage_id = _stage_id; |
40 | nb_clients = 0; | 40 | nb_clients = 0; |
41 | - _age = printed_age = 0; | 41 | + age = printed_age = 0; |
42 | 42 | ||
43 | update_print_time(); | 43 | update_print_time(); |
44 | 44 | ||
@@ -90,16 +90,16 @@ void SrsStageInfo::update_print_time() | @@ -90,16 +90,16 @@ void SrsStageInfo::update_print_time() | ||
90 | 90 | ||
91 | void SrsStageInfo::elapse(int64_t diff) | 91 | void SrsStageInfo::elapse(int64_t diff) |
92 | { | 92 | { |
93 | - _age += diff; | 93 | + age += diff; |
94 | } | 94 | } |
95 | 95 | ||
96 | bool SrsStageInfo::can_print() | 96 | bool SrsStageInfo::can_print() |
97 | { | 97 | { |
98 | int64_t can_print_age = nb_clients * pithy_print_time_ms; | 98 | int64_t can_print_age = nb_clients * pithy_print_time_ms; |
99 | 99 | ||
100 | - bool can_print = _age >= can_print_age; | 100 | + bool can_print = age >= can_print_age; |
101 | if (can_print) { | 101 | if (can_print) { |
102 | - _age = 0; | 102 | + age = 0; |
103 | } | 103 | } |
104 | 104 | ||
105 | return can_print; | 105 | return can_print; |
@@ -54,7 +54,7 @@ public: | @@ -54,7 +54,7 @@ public: | ||
54 | int pithy_print_time_ms; | 54 | int pithy_print_time_ms; |
55 | int nb_clients; | 55 | int nb_clients; |
56 | public: | 56 | public: |
57 | - int64_t _age; | 57 | + int64_t age; |
58 | int64_t printed_age; | 58 | int64_t printed_age; |
59 | public: | 59 | public: |
60 | SrsStageInfo(int _stage_id); | 60 | SrsStageInfo(int _stage_id); |
-
请 注册 或 登录 后发表评论