Proper VA-API support

…or at least fix bugs that block nvidia-vaapi-driver from working better (like this one).