[Matroska-devel] timecode scale handling & sample precision

Moritz Bunkus moritz at bunkus.org
Sun Aug 1 16:54:50 CEST 2004


Problem solved, thanks to Atamido.

> $unscaled_timecode = 1000000000ll * $sample / $sample_rate 
> Easy enough. Even better wound be using double precision and rounding,
> but 1ns is WAY below any sensible $sample_rate so we can live with the
> imprecision of just truncating this value to the lower ns.

This is bullshit :) You have to round here as well. See the attached
test program.


If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcscale-working.c
Type: text/x-csrc
Size: 1458 bytes
Desc: not available
URL: <http://lists.matroska.org/pipermail/matroska-devel/attachments/20040801/0ec2bf50/attachment.c>

More information about the Matroska-devel mailing list