mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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 {
|
for len(readerCache) == 0 && !readerEOF {
|
||||||
buf := make([]uint8, 4096)
|
buf := make([]uint8, 4096)
|
||||||
n, err := reader.Read(buf)
|
n, err := reader.Read(buf)
|
||||||
|
readerCache = append(readerCache, buf[:n]...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
readerEOF = true
|
readerEOF = true
|
||||||
@ -57,7 +58,6 @@ func Get_Byte() C.unsigned {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
readerCache = buf[:n]
|
|
||||||
}
|
}
|
||||||
if len(readerCache) == 0 {
|
if len(readerCache) == 0 {
|
||||||
return eof
|
return eof
|
||||||
|
Loading…
Reference in New Issue
Block a user