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

Corey Hickey bugfood-ml at fatooh.org
Tue Apr 25 00:30:58 CEST 2006


Ivan Kalvachev wrote:
> 2006/4/25, Corey Hickey <bugfood-ml at fatooh.org>:
>> 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.
> 
> This is not cosmetic change. Cosmetic changes doesn't make code slower ;)

:)

No, I mean how the patch moves curly-braces from the end of the line to 
a new line. There were other instances.

Personally, I don't care one way or another in this case, but if I were 
the maintainer of some file I wouldn't really want simple changes to 
alter the style.

It doesn't matter much.

>> 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. :)
> 
> I though Uoti is nominated for developer. I'm surprised he is not
> granted with cvs access yet.
> What does the other think?

Dominik proposed it; I seconded; nobody said "no"....

-Corey




More information about the MPlayer-dev-eng mailing list