优化视频的输出
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user