vdpau fixes

6e23024 is required on AMD with Mesa >= 10.1
3102d2a cherry-picked from #4162