Tidy up and refactor of audio decode codec handling