audio/mp3: Rename sideInfo to sideInfoBytes

This commit is contained in:
Hajime Hoshi 2017-06-18 17:24:33 +09:00
parent 2b54013ccc
commit 80e6d4a175

View File

@ -122,13 +122,13 @@ func (f *frame) readAudioL3() error {
return nil return nil
} }
// A sideInfo is a bit reservoir for side info // A sideInfoBytes is a bit reservoir for side info
type sideInfo struct { type sideInfoBytes struct {
vec []int vec []int
idx int // Index into the current byte(0-7) idx int // Index into the current byte(0-7)
} }
func getSideinfo(size int) (*sideInfo, error) { func getSideinfo(size int) (*sideInfoBytes, error) {
buf := make([]int, size) buf := make([]int, size)
n := 0 n := 0
var err error var err error
@ -144,13 +144,13 @@ func getSideinfo(size int) (*sideInfo, error) {
return nil, fmt.Errorf("mp3: couldn't read sideinfo %d bytes at pos %d: %v", return nil, fmt.Errorf("mp3: couldn't read sideinfo %d bytes at pos %d: %v",
size, getFilepos(), err) size, getFilepos(), err)
} }
s := &sideInfo{ s := &sideInfoBytes{
vec: buf[:n], vec: buf[:n],
} }
return s, nil return s, nil
} }
func (s *sideInfo) getSideBits(num int) int { func (s *sideInfoBytes) getSideBits(num int) int {
// Form a word of the next four bytes // Form a word of the next four bytes
// TODO: endianness? // TODO: endianness?
b := make([]int, 4) b := make([]int, 4)