neagix/Go-SDL — pull request #6 by sqweek (2014-01-07 18:52:14+00:00)
Title: SDL_sound: Various fixes/cleanup.

As I've begun to use SDL_sound in less trivial ways, some mistakes with my initial bindings have come to light. This patch addresses several problems:

NewSampleFromFile() tried to dereference a null pointer if the
corresponding C call failed. The Go signature has changed and
it now returns an error in this case.

GetError() now returns an error instead of string.

Buffer_int16() always returned a full buffersize worth of
samples, even if the entire buffer was not filled in the last
call to Decode()/DecodeAll() (eg. at EOF). It now only
returns the samples that were actually read.