Skip to content

Commit

Permalink
swWriter: remove unneeded Mutex in sample enqueing function
Browse files Browse the repository at this point in the history
  • Loading branch information
dh1tw committed Dec 12, 2021
1 parent 3534d1e commit 648a80f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions audio/sinks/scWriter/scWriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,7 @@ func (p *ScWriter) Write(msg audio.Msg) error {
// if the aData contains multiples of the expected buffer size,
// then we chop it into (several) buffers
if len(aData) >= expBufferSize {
p.Lock()
vol := p.volume
p.Unlock()

for len(aData) >= expBufferSize {
if vol != 1 {
Expand All @@ -336,8 +334,6 @@ func (p *ScWriter) Write(msg audio.Msg) error {
}

func (p *ScWriter) enqueue(bData [][]float32, EOF bool) {
p.Lock()
defer p.Unlock()
for _, frame := range bData {
p.ring.Enqueue(frame)
}
Expand Down

0 comments on commit 648a80f

Please sign in to comment.