[MPlayer-dev-eng] Fixes/enhancements to vdpau

Dan Oscarsson Dan.Oscarsson at tietoenator.com
Mon Apr 6 15:33:34 CEST 2009


On 2009-04-06 at 15:35 +0300 Uoti Urpala wrote:
> On Mon, 2009-04-06 at 13:22 +0200, Dan Oscarsson wrote:
> > My patches include:
> 
> Are these patches visible somewhere? Some comments below based on what
> your descriptions tell.

No, I wanted to hear your comments before I post them.

> 
> >   - an option to vdpau: max-delay
> >     which if set to 0 results in 2 output surfaces and working
> >     like current code.
> >     if set will drop frames if a frame would be delayed longer
> >     then given value.
> 
> Drop which frame? Dropping the latest frame before seeing the following
> ones is always undesirable as you can't know when or if those next ones
> appear - playback may pause and then you'd be stuck showing the wrong
> frame.

I normally allow a delay of 1,3 vsyncs. Then there will be at least one
frame in the queue to be displayed. So I know that at least one more
will be displayed. If I do not drop the queue of frames to display will
grow and you have to wait for it to drain easily getting audio out of
sync.

> 
> >                       the number of output surfaces will be adjusted to
> >     match.
> 
> Adjusted how? How can you map times to numbers of surfaces? Are you
> making assumptions about the video having a consistent FPS?

The max delay is in vsyncs, the number of output surfaces is set to the
number needed to handle that max delay in shown a frame.

> 
> >   - a global option: match-vsync-speed
> >     that will change speed of movie to vsync speed (if nearly the same).
> >     this allows movies to be shown with less frame dropping.
> 
> Change based on what? Are you making assumptions about the video having
> an FPS value? Or using some kind of more local logic (what?). And how do
> you change the speed?

It is based on the fps value of the video. And currently I assume it is
constant - most movies are. The speed is changed by changing
playback_speed (i.e. the same as change speed with the speed option).

I have tried to dynamically change speed but each change disrupts
mplayer to much. Would probably be easier to do if mplayer was
multi-threaded.

> 
> >   - a global option: card-time-correction
> >     that gives correction that is needed to correct that graphics card
> >     have a time that have a different speed then system time.
> 
> Do you really need this? Can such differences not be corrected for
> automatically at runtime?

I tried, but the difference is very small so it is better to calculate
it once for each card you have using a long time period to measure over.

> 
> >   - an option to vdpau: time-corr
> >     which measures card time and prints correction value at end of
> >     movie. To be used with option: card-time-correction
> 
> What does this measure against? If there is no sound then the system
> clock is what matters; but in the usual case where there is sound the
> system clock has little significance and the important reference is the
> audio playback speed.

I query using vdpau the card time and the system time at vo init, and
then again at uninit. Then calculate the correction based on how much
the card time and system time differ.




More information about the MPlayer-dev-eng mailing list