优化视频的输出

This commit is contained in:
2024-11-13 17:39:23 +08:00
parent 28291598bb
commit 6ee3a6fc11

View File

@@ -29,18 +29,19 @@ func Play(ctx context.Context, file string) error {
wait.Add(1)
go func() {
defer wait.Done()
reader := bufio.NewReader(pipe)
for {
select {
case <-a:
default:
line, _, err := bufio.NewReader(pipe).ReadLine()
line, _, err := reader.ReadLine()
if err != nil {
if err == io.EOF {
return
}
break
}
zap.S().Infoln(string(line))
zap.L().Info(string(line))
}
}
}()