[MPlayer-dev-eng] Low resolution on pts in demux_mkv

Dan Oscarsson Dan.Oscarsson at tieto.com
Sun Oct 4 17:32:08 CEST 2009

On 2009-10-04 at 18:18 +0300 Uoti Urpala wrote:
> On Sun, 2009-10-04 at 17:10 +0200, Dan Oscarsson wrote:
> > I have been looking at pts values for some time. pts values from .mkv
> > files end up with low resolution even if the pts values in the .mkv file
> > have a high resolution. This is due to the code in
> > libmpdemux/demux_mkv.c
> > 
> > In handle_block pts values are calculated from:
> > 
> >     tc = ((time*mkv_d->tc_scale+mkv_d->cluster_tc) /1000000.0 - mkv_d->first_tc);
> > 
> > As tc is an integer, precision will be lost.
> That rounded precision is still 1/1000 second here. That's not exactly
> "low resolution". Do you really need more precision? Do your files
> really use a tc_scale that would give more actual precision even without
> rounding?

I have been working on problems when move fps is same as display refresh
rate. A 23.976hz movie in .mkv gets video pts: 0, 0.042, 0.083, 0.125.
The time between frames are 42 ms, 41 ms, 42 ms.
So when mplayer displays frames the time between frames will vary and
that will now and then result in uneven display when frame flip happens
around vsync time.

Though I am working on code that will take vsync time into account when
doing a flip.



More information about the MPlayer-dev-eng mailing list