mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
mp3: Add comment about error handling
This commit is contained in:
parent
31796150e7
commit
b46ed224a7
@ -181,8 +181,14 @@ func decode(context *audio.Context, buf []uint8) (*Stream, error) {
|
|||||||
ch <- fmt.Errorf("audio/mp3: number of channels must be 1 or 2 but %d", n)
|
ch <- fmt.Errorf("audio/mp3: number of channels must be 1 or 2 but %d", n)
|
||||||
}
|
}
|
||||||
close(ch)
|
close(ch)
|
||||||
}, func() {
|
}, func(err *js.Object) {
|
||||||
ch <- errTryAgain
|
if err != nil {
|
||||||
|
ch <- fmt.Errorf("audio/mp3: decodeAudioData failed: %v", err)
|
||||||
|
} else {
|
||||||
|
// On Safari, error value might be null and it is needed to retry decoding
|
||||||
|
// from the next frame (#438).
|
||||||
|
ch <- errTryAgain
|
||||||
|
}
|
||||||
close(ch)
|
close(ch)
|
||||||
})
|
})
|
||||||
if err := <-ch; err != nil {
|
if err := <-ch; err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user