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

refine hls info, show the deviation in seconds and pieces.

This commit is contained in:
winlin 2015-04-07 10:30:45 +08:00
parent 6e2d756e1b
commit e7fd309cb0
2 changed files with 10 additions and 2 deletions

View file

@ -272,6 +272,13 @@ double SrsHlsMuxer::deviation()
return hls_fragment_deviation;
}
int SrsHlsMuxer::absolute_deviation()
{
// accept the floor ts for the first piece.
int64_t floor_ts = (int64_t)(srs_get_system_time_ms() / (1000 * hls_fragment));
return (int)(accept_floor_ts - (floor_ts - 1));
}
int SrsHlsMuxer::initialize(ISrsHlsHandler* h)
{
int ret = ERROR_SUCCESS;
@ -1203,9 +1210,9 @@ void SrsHls::hls_show_mux_log()
// the run time is not equals to stream time,
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/81#issuecomment-48100994
// it's ok.
srs_trace("-> "SRS_CONSTS_LOG_HLS" time=%"PRId64", stream dts=%"PRId64"(%"PRId64"ms), sequence_no=%d, ts=%s, duration=%.2f, deviation=%.2f",
srs_trace("-> "SRS_CONSTS_LOG_HLS" time=%"PRId64", stream dts=%"PRId64"(%"PRId64"ms), sno=%d, ts=%s, dur=%.2f, dva=%.2fs/%dp",
pprint->age(), stream_dts, stream_dts / 90, muxer->sequence_no(), muxer->ts_url().c_str(),
muxer->duration(), muxer->deviation());
muxer->duration(), muxer->deviation(), muxer->absolute_deviation());
}
}

View file

@ -237,6 +237,7 @@ public:
virtual std::string ts_url();
virtual double duration();
virtual double deviation();
virtual int absolute_deviation();
public:
/**
* initialize the hls muxer.