From 6ee3a6fc11166286489df9e5d86d1c83e592eddb Mon Sep 17 00:00:00 2001 From: mapleafgo Date: Wed, 13 Nov 2024 17:39:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=86=E9=A2=91=E7=9A=84?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/video/paly.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/video/paly.go b/pkg/video/paly.go index d03dd42..2b09f1f 100644 --- a/pkg/video/paly.go +++ b/pkg/video/paly.go @@ -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)) } } }()