I have updated the midi-buffer branch with the previous two suggestions:
1. fluid_player_add_mem now copies the buffer before it stores it, so
the caller can now free it immediately (and it is now the caller's
responsibility to free).
2. Internally, fluid_midi_file now uses int buf_len and buf_pos instead
of pointers. This just makes things a little easier to think about.
As usual, I currently have it in a Bazaar branch in Launchpad here:
https://code.launchpad.net/~mgiuca/fluidsynth/midi-buffer
use:
bzr branch lp:~mgiuca/fluidsynth/midi-buffer
The full patch against the trunk (SVN r406) is viewable and downloadable
here:
http://bazaar.launchpad.net/~mgiuca/fluidsynth/midi-buffer/revision/360?compare_revid=336.1.14
The patch against my previous draft is here:
http://bazaar.launchpad.net/~mgiuca/fluidsynth/midi-buffer/revision/360?compare_revid=337
The example in the documentation has been updated to reflect the new
usage model.
It should be ready to merge now. The full patch can be downloaded here:
http://bazaar.launchpad.net/~mgiuca/fluidsynth/midi-buffer/diff/360/336.1.14