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

This commit is contained in:
winlin 2014-05-14 14:34:28 +08:00
parent b175821b62
commit cbbf53f8f9
3 changed files with 104 additions and 72 deletions

View file

@ -30,6 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp>
#include <srs_app_reload.hpp>
// the pithy stage for all play clients.
#define SRS_STAGE_PLAY_USER 1
// the pithy stage for all publish clients.
@ -45,6 +47,26 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// the pithy stage for all edge.
#define SRS_STAGE_EDGE 7
class SrsStageInfo : public ISrsReloadHandler
{
public:
int stage_id;
int pithy_print_time_ms;
int nb_clients;
public:
int64_t _age;
int64_t printed_age;
public:
SrsStageInfo(int _stage_id);
virtual ~SrsStageInfo();
virtual void update_print_time();
public:
virtual void elapse(int64_t diff);
virtual bool can_print();
public:
virtual int on_reload_pithy_print();
};
/**
* the stage is used for a collection of object to do print,
* the print time in a stage is constant and not changed.
@ -58,7 +80,6 @@ private:
int stage_id;
// in ms.
int64_t _age;
int64_t printed_age;
int64_t previous_tick;
public:
/**