Adjust for libav 10 API
With libav 10 the API is (again...) changed, adjust for that and
add the appropriate version conditions