Let recorder worker close encoder stdin
This commit is contained in:
committed by
Brandon McGinty
parent
d07d7342da
commit
e309d22137
@@ -128,10 +128,9 @@ func (r *Recorder) Stop() error {
|
||||
return nil
|
||||
}
|
||||
r.once.Do(func() {
|
||||
// run owns stdin and closes it only after it has stopped writing.
|
||||
// Closing it here races writePCM and turns a normal stop into EPIPE.
|
||||
close(r.stop)
|
||||
if r.stdin != nil {
|
||||
r.stdin.Close()
|
||||
}
|
||||
})
|
||||
select {
|
||||
case <-r.done:
|
||||
|
||||
Reference in New Issue
Block a user