Let recorder worker close encoder stdin

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 14:50:29 -04:00
committed by Brandon McGinty
parent d07d7342da
commit e309d22137
3 changed files with 26 additions and 4 deletions
+2 -3
View File
@@ -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: