mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-05 07:24:30 +01:00
audio/internal/readerdriver: Change the timing of updating the player state (Windows)
This commit is contained in:
parent
c54e5371ad
commit
646f48ef09
@ -467,6 +467,10 @@ func (p *playerImpl) playImpl() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the state before adding the player so that the audio loop can start to play it immediately.
|
||||||
|
// This is a little tricky since this depends on the timing of Signal().
|
||||||
|
p.state = playerPlay
|
||||||
|
|
||||||
// thePlayers can has another mutex, and double mutex might introduce a deadlock.
|
// thePlayers can has another mutex, and double mutex might introduce a deadlock.
|
||||||
p.m.Unlock()
|
p.m.Unlock()
|
||||||
err := thePlayers.add(p)
|
err := thePlayers.add(p)
|
||||||
@ -477,7 +481,6 @@ func (p *playerImpl) playImpl() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
p.state = playerPlay
|
|
||||||
// Do not create the player's own loop. Scheduling on Winodws is inefficient compared to the other OSes.
|
// Do not create the player's own loop. Scheduling on Winodws is inefficient compared to the other OSes.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user