build: make it work on somewhat older ffmpeg versions

Tested with n0.10.4. All these version checks are rather tricky,
because Libav and FFmpeg change the same thing at slightly different
versions.