From: Hraban Luyat Date: Sat, 21 Feb 2015 03:53:24 +0000 (+0000) Subject: Fix error reporting in DecodeFloat32() X-Git-Tag: v2.0.0~124 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=53e78907ff90f91801a070de788fd519ed1acdc5;p=go-opus.git Fix error reporting in DecodeFloat32() --- diff --git a/api.go b/api.go index 9cd149b..ea86a52 100644 --- a/api.go +++ b/api.go @@ -99,7 +99,6 @@ func NewDecoder(sample_rate int, channels int) (*Decoder, error) { } func (dec *Decoder) DecodeFloat32(data []byte) ([]float32, error) { - var errno int // I don't know how big this frame will be, but this is the limit pcm := make([]float32, xMAX_FRAME_SIZE_MS*dec.sample_rate/1000) n := int(C.opus_decode_float( @@ -110,7 +109,7 @@ func (dec *Decoder) DecodeFloat32(data []byte) ([]float32, error) { C.int(cap(pcm)), 0)) if n < 0 { - return nil, opuserr(errno) + return nil, opuserr(n) } return pcm[:n], nil }