mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
audio: mixedPlayerStream.Read now may return 0 byte result
This commit is contained in:
parent
976d61816c
commit
6d85d82c85
@ -43,13 +43,12 @@ func (s *mixedPlayersStream) Read(b []byte) (int, error) {
|
||||
s.context.Lock()
|
||||
defer s.context.Unlock()
|
||||
|
||||
l := len(b) / 4 * 4
|
||||
if len(s.context.players) == 0 {
|
||||
copy(b, make([]byte, l))
|
||||
return l, nil
|
||||
return 0, nil
|
||||
}
|
||||
closed := []*Player{}
|
||||
bb := make([]byte, max(1024, l))
|
||||
l := len(b) / 4 * 4
|
||||
bb := make([]byte, l)
|
||||
ll := l
|
||||
for p := range s.context.players {
|
||||
n, err := p.src.Read(bb)
|
||||
|
Loading…
Reference in New Issue
Block a user