neagix/Go-SDL — pull request #7 by sqweek (2014-01-08 14:16:22+00:00)
Title: SDL_sound: Various fixes/cleanup.

Sorry about the messing around. I forgot to change a := to = in a last minute change I made to the previous pull request.

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 read in the last
call to Decode()/DecodeAll() (eg. at EOF). It now only
returns the samples that were actually read.