Smooth framerate patch

This is the patch supplied by Bjoern Gdanietz. More than a year ago.

It never got merged in on the original project due to a few minor problems and DanV no longer seeming to be around.