credits patch by (Måns Rullgård <mru at mru dot ath dot cx>)