[Matroska-devel] Re: Timestamp precision in matroska files
steve.lhomme at free.fr
Fri Jan 9 16:34:13 CET 2004
Ronald Bultje wrote:
> On Fri, 2004-01-09 at 16:05, Christian HJ Wiesner wrote:
>>Moritz Bunkus wrote:
>>>FLOAT WARNING! If we ever want Matroska to become a reality on hardware
>>>devices then using floats everywhere is a big no!
> Eh, samplerate already is a float, so you might be a little late...
> I do agree, though.
The sampling rate is not used anywhere else in the format. So it can be
computed once and you're done. With a floating point library it's no big
The problem is the precision of TrackTimecodeScale. I made the same
(successful) test but with float instead of double. And the
approximation fails (to estimate the actual timecode of a sample in ns)
at the 372nd sample. So the single precision floating point is not
enough for sample accurate seeking. But as this timecode complete
accuracy will be needed only for seeking (during playback a delay of a
few ns is not a big deal). It is only computed in rare cases. So using a
third party library for that won't have much performance impact anyway.
More information about the Matroska-devel