fixes variable fps and improper A/V sync (issue  #9)