[MPlayer-dev-eng] PTS system broken..

Charles Henrich henrich at sigbus.com
Thu Feb 28 23:07:15 CET 2002


Okay, so I've been spending a fair amount of time tracking this down, and
basically the pts system cannot ever work reliably.  This is why.

It uses floating point numbers as counters and relies on them being accurate.
Floating point numbers by design are not accurate, they cannot be due to the
bits available.

If you look at this expression:

8.52 - 8.48 

The output is not .40, but really .40001

So what happens is the duplicate code goes something like, "hey as long as
there is a difference, duplicate a frame".  So it checks the difference
(.40001 - .40) and behold, there is one.  but in reality, there isnt.  So a
duplicate frame is (incorrectly) inserted.

I imagine much the same thing is happening in the skip code, but so far it
looks convoluted, so I havent been able to track down exactly whats happening
there.  

The moral is, all these counter and synchronization routines should be doing
sync based on long long's and integer counts, not floating point numbers..

Arpi?

-Crh

       Charles Henrich                                   henrich at msu.edu

                       http://www.sigbus.com:81/~henrich



More information about the MPlayer-dev-eng mailing list