Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for comments on leap second handling #1242

Closed
sandersaares opened this issue Jan 23, 2018 · 6 comments
Closed

Request for comments on leap second handling #1242

sandersaares opened this issue Jan 23, 2018 · 6 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: question A question from the community

Comments

@sandersaares
Copy link
Contributor

DASH-IF has published document for community review.

LEAP SECOND HANDLING CLARIFICATIONS

  • The change request against IOP v4.1 for Community Review is accessible here
  • Community review is open until April 15th, 2018. Addition to IOP is expected by Q2/2018.
  • Comments may be submitted through the public bugtracker.
  • This addition adds the following main features: Clarifies how to handle leap seconds and how to avoid common pitfalls

It would be very desirable to hear some feedback from player developers on this topic!

@vaage
Copy link
Contributor

vaage commented Jan 25, 2018

@joeyparrish could you take a look at this?

@joeyparrish
Copy link
Member

@sandersaares, that all looks fine to me. Realistically, we are not going to implement a leap-second-aware clock, though. The whole thing is predicated on the use of availabilityStartTime to compute the perfect presentation timeline. But we already can't count on availabilityStartTime because of encoder drift. See #999. Ultimately, we will ignore availabilityStartTime for all but SegmentTemplate+duration manifests.

@joeyparrish joeyparrish added type: question A question from the community and removed needs triage labels Jan 25, 2018
@sandersaares
Copy link
Contributor Author

Thanks for taking a look! Glad to hear there was nothing surprising in there.

Do I understand it right from your comment about leap-second-aware clock that whatever browser based timing mechanism is used by Shaka is not leap second aware? That is to say, when Shaka currently adds a period@start to MPD@availabilityStartTime, is the former added as a duration of Unix ticks, thereby ending up with a result N seconds in the future compared to real time (where N is the elapsed count of leap seconds)?

@joeyparrish
Copy link
Member

We use Date.parse to parse XML date strings. I don't know if it is leap-second aware or not. We convert date strings into seconds since 1970. See shaka.util.XmlUtils.parseDate.

In your example, we compare the results of Date.parse with the results of Date.now to understand how long the stream has been running and compute the ideal presentation time of the live edge. Clock sync, if used, will offset Date.now by some amount first.

@ddorwin
Copy link

ddorwin commented Jan 26, 2018

For what it's worth, EME's definition of time is at https://w3c.github.io/encrypted-media/#time. It defers to ECMAScript Date Objects where "In time values leap seconds are ignored."

@sandersaares
Copy link
Contributor Author

It does indeed look like Date.parse ignores leap seconds, which will likely lead to an availability timeline de-sync for content that uses real-time-accurate timing.

I will close this now as comments were received and questions answered. Thanks!

@shaka-project shaka-project locked and limited conversation to collaborators Mar 31, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: question A question from the community
Projects
None yet
Development

No branches or pull requests

5 participants