audio: Bug fix: bufferToInt16 can return smaller result

Fixes #854
This commit is contained in:
Hajime Hoshi 2019-04-29 00:32:52 +09:00
parent 835497edd3
commit 96012b661f

View File

@ -97,6 +97,9 @@ func (m *mux) Read(b []byte) (int, error) {
if err != nil { if err != nil {
return 0, err return 0, err
} }
if l > len(buf)*2 {
l = len(buf) * 2
}
b16s = append(b16s, buf) b16s = append(b16s, buf)
} }