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

Refine SrsFragment.start_dts in time unit

This commit is contained in:
winlin 2019-04-18 08:01:17 +08:00
parent 288bed6e26
commit f5a1f9b774
3 changed files with 6 additions and 6 deletions

View file

@ -129,7 +129,7 @@ private:
uint64_t audio_dts;
uint64_t video_dts;
private:
// The fragment duration in ms to reap it.
// The fragment duration in srs_utime_t to reap it.
srs_utime_t fragment;
private:
std::string home;

View file

@ -53,12 +53,12 @@ void SrsFragment::append(int64_t dts)
}
if (start_dts == -1) {
start_dts = dts;
start_dts = dts * SRS_UTIME_MILLISECONDS;
}
// TODO: FIXME: Use cumulus dts.
start_dts = srs_min(start_dts, dts);
dur = srs_utime_t(dts - start_dts) * SRS_UTIME_MILLISECONDS;
start_dts = srs_min(start_dts, dts * SRS_UTIME_MILLISECONDS);
dur = dts - start_dts;
}
srs_utime_t SrsFragment::duration()

View file

@ -40,8 +40,8 @@ private:
srs_utime_t dur;
// The full file path of fragment.
std::string filepath;
// The start DTS in ms of segment.
int64_t start_dts;
// The start DTS in srs_utime_t of segment.
srs_utime_t start_dts;
// Whether current segement contains sequence header.
bool sequence_header;
public: