mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-24 18:02:02 +01:00
audio: Refactoring: Use the underlying source's Seek in Read
This commit is contained in:
parent
bdf78dab27
commit
15ba3ed4d1
@ -83,12 +83,13 @@ func (i *InfiniteLoop) Read(b []byte) (int, error) {
|
||||
}
|
||||
|
||||
if err == io.EOF || i.pos == i.length() {
|
||||
pos, err := i.Seek(i.lstart, io.SeekStart)
|
||||
pos, err := i.src.Seek(i.lstart, io.SeekStart)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i.pos = pos
|
||||
}
|
||||
|
||||
return n, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user