2

I'm trying to use the MediaElement control in WPF to play back video. It works great in Vista, but when I run it on an XP machine I get tearing in the display. It looks as if it's not using the vertical synch, and just updating the screen mid-draw.

Anyone know how to fix this problem?

GeekyMonkey
  • 12,478
  • 6
  • 33
  • 39
  • Since I have not found a solution, I've decided to host a Windows Media Player instance in my application using interop. It basically works (and no tearing), but I can't do the fancy stuff I planned on doing with WPF like cross-fading between videos. Bummer... – GeekyMonkey Jan 15 '09 at 12:22
  • Speculation: There might be settings on your video card driver that could control this, e.g forcing VSync. This would be card/driver specific. Not sure if you can request a wait for vsync with the mediaelement, or even if the video card is required to honor it (it might not if the user chooses some sort of force no-vsync in their drivers config). – Merlyn Morgan-Graham Aug 28 '11 at 05:30

1 Answers1

2

This has more to do with the way WPF renders to the screen under XP compared to Vista. Under Vista, apps render to an offscreen buffer which is then composited with other windows that have changed and is presented to the screen at the appropriate intervals by a process called DWM.exe. That can (and presumably does) present WPF's window updates to the video buffer synchronized with the refresh interval.

On XP WPF uses DirextX to render straight to the screen and updates the video buffer whenever it wants to. There might be some way to get it to synchronise with the refresh interval, but I haven't looked into it because I don't use XP any more.

U62
  • 4,355
  • 1
  • 24
  • 37