mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
audio/mp3: Bug fix: updating cache in getBytes wrongly
This commit is contained in:
parent
e5fbcd50de
commit
bdb87b0257
@ -50,6 +50,7 @@ func Get_Byte() C.unsigned {
|
||||
for len(readerCache) == 0 && !readerEOF {
|
||||
buf := make([]uint8, 4096)
|
||||
n, err := reader.Read(buf)
|
||||
readerCache = append(readerCache, buf[:n]...)
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
readerEOF = true
|
||||
@ -57,7 +58,6 @@ func Get_Byte() C.unsigned {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
readerCache = buf[:n]
|
||||
}
|
||||
if len(readerCache) == 0 {
|
||||
return eof
|
||||
|
Loading…
Reference in New Issue
Block a user