From bcd7bfc74e72751caa9af0b1ee1e6f052eb0715d Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 11 Mar 2016 04:17:19 +0900 Subject: [PATCH] audio: Bug fix: mixedPlayersStream.Read must return 0 when nothing plays (#180) --- exp/audio/audio.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/exp/audio/audio.go b/exp/audio/audio.go index 19619d9ec..fdf5b4245 100644 --- a/exp/audio/audio.go +++ b/exp/audio/audio.go @@ -33,22 +33,13 @@ func min(a, b int) int { return b } -func max(a, b int) int { - if a > b { - return a - } - return b -} - 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 { - ll := min(4096, len(b)) - copy(b, make([]byte, ll)) - return ll, nil + return 0, nil } closed := []*Player{} ll := l