Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

More duration updates #339

Closed
wants to merge 6 commits into from
Closed

Conversation

dmlap
Copy link
Member

@dmlap dmlap commented Jul 6, 2015

Pulled in #279 so that seeking "between segments" does not cause an error. Updated duration calculation so that PTS-based results are used for the largest span of segments possible. Previously, PTS values were only used to calculate duration when they formed a continuous interval. This is a lot more conservative than necessary because PTS values are directly comparable unless there is a discontinuity between their containing segments. This method should result in more accurate calculations and get rid of some unnecessary segment iteration.

mikrohard and others added 5 commits June 29, 2015 10:51
The more video is buffered, the more accurate our calculation of currentTime becomes. Make sure we don't artificially anchor our currentTime calculation and then get out of sync once more video has been downloaded.
Break segmentsDuration up into more manageable parts.
Instead of calculating the duration by accumulating spans with and without PTS info from left to right, find the largest continuous span that has PTS information and then add up EXT-INF based durations before and after those spans. To make this proces simpler, split the interval we are calculating into segment sequences with continuous timestamps. Add segment indices for discontinuities to the m3u8 parser to support splitting intervals.
Playlist.duration() does a more comprehensive job of managing calculations with PTS values and discontinuities so remove reference on segmentParser.
@dmlap
Copy link
Member Author

dmlap commented Jul 7, 2015

Also, closes #314

@@ -375,7 +375,8 @@

// the manifest is empty until the parse stream begins delivering data
this.manifest = {
allowCache: true
allowCache: true,
discontinuityStarts: []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so discontinuityStarts end up being a list of indexes pointing at segments that begin a discontinuity?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It makes splitting intervals into continuous spans a lot simpler.

This function was obsoleted by Playlist.duration() and unused.
@dmlap dmlap closed this in 5530370 Jul 10, 2015
@dmlap dmlap deleted the review-mikrohard-hls-fixes branch July 10, 2015 20:57
@dmlap dmlap mentioned this pull request Jul 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants