[MPlayer-dev-eng] [PATCH] reduce flashing on resize with VDPAU

Dan Oscarsson Dan.Oscarsson at tietoenator.com
Mon Mar 23 18:27:15 CET 2009


mån 2009-03-23 klockan 10:26 +0100 skrev Reimar Döffinger:
> On Mon, Mar 23, 2009 at 10:18:38AM +0100, Dan Oscarsson wrote:
> > As my patches for vsync handling has not been in the way you prefer, I
> > wander if I should continue or if somebody else will fix it?
> 
> I'd prefer to see what you did so far, I think there are quite a few ways to do
> this.
> Particularly if you need an option to disable it depends how it will
> fail. E.g. if the "fail" case is not really any worse than the
> "disabled" behaviour an option is quite pointless.

Attached is my current version after having removed all code not related
to the basic vsync handling. I have some more code I use to increase
debugging and other that is used to change speed on a movie so that it
nearly matches the vsync speed (nice when running a 24hz movie on a 24
hz screen).

The two variables in video_out is there because I have code in mplayer.c
that shows frames dropped in vo on status line, and to make it possible
to match speed as described above.

get_vdpau_timing is called from config to get the time between two
vsyncs. This will set vo_vsync_interval to that. If the blitting
interface is used, as it does not align surface display on vsync, this
will be detected and leave vo_vsync_interval set to 0. When blitting
also aligns on vsync, it will no longer be detected.

The code in flip_page will, if vo_vsync_interval is set, drop frames if
the delay before display of current surface is to large.
Currently hardcoded to 1.3 vsync intervals (suitable with 4 output
surfaces). It should always include a fraction of an interval as the
small jitter in display time from mplayer can, when flip is called at
the same time a vsync occurs, result in many frames dropped.

With this code and my speed aligning code, I could watch a 24 hz movie
on a 24 hz screen with about one frame dropped per 10 minutes.

  Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vdpauvsync.diff
Type: text/x-patch
Size: 9257 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090323/a2ab93cf/attachment.bin>


More information about the MPlayer-dev-eng mailing list