mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
audio/internal/convert: return an error when not seekable
This commit is contained in:
parent
b0753008ab
commit
531dc7efd9
@ -15,6 +15,7 @@
|
|||||||
package convert
|
package convert
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"math"
|
"math"
|
||||||
)
|
)
|
||||||
@ -78,7 +79,7 @@ func (r *float32BytesReader) Read(buf []byte) (int, error) {
|
|||||||
func (r *float32BytesReader) Seek(offset int64, whence int) (int64, error) {
|
func (r *float32BytesReader) Seek(offset int64, whence int) (int64, error) {
|
||||||
s, ok := r.r.(io.Seeker)
|
s, ok := r.r.(io.Seeker)
|
||||||
if !ok {
|
if !ok {
|
||||||
panic("float32: the source must be io.Seeker when seeking but not")
|
return 0, fmt.Errorf("float32: the source must be io.Seeker when seeking but not")
|
||||||
}
|
}
|
||||||
r.i16Buf = r.i16Buf[:0]
|
r.i16Buf = r.i16Buf[:0]
|
||||||
r.eof = false
|
r.eof = false
|
||||||
|
Loading…
Reference in New Issue
Block a user