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

Corey Hickey bugfood-ml at fatooh.org
Tue Apr 25 08:08:22 CEST 2006


Corey Hickey wrote:
> 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.

Yep, it works fine for me so far. Go ahead and apply it, minus the 
cosmetics, once you get your CVS access.

-Corey




More information about the MPlayer-dev-eng mailing list