[MPlayer-dev-eng] Change pts values to use doubles instead of floats

Corey Hickey bugfood-ml at fatooh.org
Mon Apr 24 23:21:33 CEST 2006


Uoti Urpala wrote:
> Floats do not have sufficient precision to hold pts values in long
> streams/files. After 8192 seconds the distance between two consecutive
> floats is about 1 ms, and the error grows proportional to file length,
> so after 65536 seconds (less than a day) it's 8 ms.
> 
> The attached patch changes the common data structures to doubles. It
> does not yet change any demuxers to produce pts values with higher
> precision, many of them use floats internally.

[cut]

> -float ds_get_next_pts(demux_stream_t *ds) {
> +double ds_get_next_pts(demux_stream_t *ds)
> +{

I'm not sure little cosmetic changes like this are acceptable. I usually 
try to follow the style of the original or surrounding code, especially 
when the modification is small.


Other than that, assuming it doesn't break anything unforseen or have a 
measurable slowdown, the patch should be ok. I'm all for increasing 
precision when there is little or no expense. If nobody else applies or 
rejects it first, I'll test the patch tonight and apply it (without 
cosmetics) tomorrow.


By the way, do you use mencoder? It would be nice if mencoder could have 
a share of your sync improvements.

Keep it up. I wish I had time to work on this stuff too. :)

-Corey




More information about the MPlayer-dev-eng mailing list