Re: Chapter marks not where specified.

Tom Brock <tomb-yZYHXxUkMT10YYv+nEap2lpr/1R2p/[email protected]> Thu, 29 Mar 2012 13:16:41 +0100
Newsgroups gmane.comp.multimedia.dvdauthor.user
Message-ID <[email protected]>
Lawrence,

> 
> > I shall not be deliberately adding systematic errors to my time 
> > specifications.
> 
> I agree. I hate fudging around bugs when we can fix them. I’ve looked at
> the code, and can’t see any obvious reason for such systematic or
> semi-systematic errors. The chapter times are parsed as
> double-precision seconds in the “parsechapter” routine (dvdcli.c) and
> converted to integer timestamp values (in the usual 90kHz MPEG clock) by
> “source_add_cell” (dvdauthor.c) which also applies rounding by adding
> half a timestamp unit before converting to integer.

What is the rationale for adding 0.5?  If the timestamp is less than 16384 
seconds (which is longer than the maximum title length that I've known to 
produce a working DVD), then 1 ulp of the double representation is 2 ps.  
Rounding to nearest would seem to be the proper action, by adding 0.5, you're 
rounding up.  I also wonder why you don't use ceiling(): that way it would 
look less like a fiddle factor and more "mathematical", while, of course, 
running the risk of fooling reviewers into thinking it must be right :-)

It all depends on what is meant by the term "pts tick": is is the period of 
time between two pts clock edges (in which case, which clock edge is it 
numbered for?) or is it the number of a clock edge?  I suspect that both 
meanings apply, but at different points in the code.  By adding 0.5, you're 
assigning a timestamp to the interval between ticks, and numbered for the 
second (if the first clock tick is numbered zero).  It also means that no 
timestamp could be assigned to tick zero, and if that is required, even if 
only logically, then floor() would be more appropriate.

I really don't think this can be the root of the problem I'm seeing, since any 
possible error introduced could be only 11.11 us at most, but it's the sort of 
thing I often come across in my day job, and I can be a bit obsessive about it.

Tom Brock.

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

_______________________________________________
Dvdauthor-users mailing list
Dvdauthor-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/dvdauthor-users