[MPlayer-dev-eng] [PATCH] float comparisons and A/V desynchronization fix (mainly with real videos)

Uoti Urpala uoti.urpala at pp1.inet.fi
Fri May 5 17:02:16 CEST 2006


On Fri, 2006-05-05 at 10:33 +0200, Pierre Lombard wrote:
> The culprit file is libmpdemux/video.c: because of how floats are
> encoded in computers, you may almost never compare directly floating
> points values (floats are not a totally ordered set unlike integers for
> instance).

I think this patch is incorrect. The comparisons against 0 are because
some code still uses 0 for "unknown value" (though it should be changed
to MP_NOPTS_VALUE now). In that case it is set to 0 exactly, and floats
do not spontaneously change value or become less precise.

If you really get "dramatic improvement" in some real videos, then the
demuxer must be doing something weird (setting the timestamp to a value
near 0 in the middle of the video, but not by setting it directly to 0),
or the video must have broken timestamps.




More information about the MPlayer-dev-eng mailing list