-
-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples/audio: a race is detected when seeking #3173
Labels
Milestone
Comments
I could reproduce this on macOS too. |
The easiest (but dumb) fix is: diff --git a/internal/mux/mux.go b/internal/mux/mux.go
index 28df789..67878ae 100644
--- a/internal/mux/mux.go
+++ b/internal/mux/mux.go
@@ -251,10 +251,11 @@ func (p *playerImpl) setBufferSize(bufferSize int) {
}
func (p *playerImpl) ensureTmpBuf() []byte {
- if p.tmpbuf == nil {
+ /*if p.tmpbuf == nil {
p.tmpbuf = make([]byte, p.bufferSize)
}
- return p.tmpbuf
+ return p.tmpbuf*/
+ return make([]byte, p.bufferSize)
} in Oto. |
hajimehoshi
changed the title
Audio race
examples/audio: a race is detected when seeking
Dec 23, 2024
The culprit is temporary unlocking locks when reading data |
hajimehoshi
added a commit
to ebitengine/oto
that referenced
this issue
Dec 23, 2024
hajimehoshi
added a commit
to ebitengine/oto
that referenced
this issue
Dec 23, 2024
hajimehoshi
added a commit
that referenced
this issue
Dec 23, 2024
Thanks. I'll tag v2.8.6 a few days later. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ebitengine Version
v2.8.5
Operating System
Go Version (
go version
)1.22
What steps will reproduce the problem?
then click on the seek bar while the music is playing
What is the expected result?
The cursor jumps to the clicked location (or at least jumps forward), and the music jumps as well, and keeps playing.
What happens instead?
The cursor does not move, and the music gets all choppy.
Also the console shows a data race. 😅
Anything else you feel useful to add?
If we first pause the music by clicking the ⏸️ button, then click the seek bar, then the play button, it works fine.
But I guess being able to do it all at once within the same
Update
call would be nice. 🤔The text was updated successfully, but these errors were encountered: