Git Product home page Git Product logo

Comments (1)

cpearce avatar cpearce commented on June 2, 2024

The duration and time_update are seconds in doubles because the HTMLMediaElement spec has the time values it exposes as floats. So we're matching the target API's spec here.

If we wanted to export duration and time_update as some kind of TimeStamp, we'd be converting to a TimeStamp in gecko-media, and then converting back to a floating point value when Servo exposed them to JavaScript content.

We should certainly not use floats for time values everywhere, as we're liable to lose precision if we do; we've been burned by that in the past when we were a little greener.

Note that the TimeStamps on frames represent a wall-clock absolute time point, whereas the duration represents a range of time, and the time_update time represents an offset from 0. So they're not semantically all the same concept of time anyway. So rather than unifying into a single concept of TimeStamp, it would make more sense to create TimeDuration and TimeOffset structs for the duration and time_update values rather than making them all TimeStamps.

from gecko-media.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.