From 4e742159af79cf0f6a14da630a362a0344a5a121 Mon Sep 17 00:00:00 2001 From: Keuin Date: Thu, 15 Sep 2022 00:58:10 +0800 Subject: Make copy and write IO operations async. --- bilibili/streaming.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bilibili/streaming.go') diff --git a/bilibili/streaming.go b/bilibili/streaming.go index ea9207c..0bda347 100644 --- a/bilibili/streaming.go +++ b/bilibili/streaming.go @@ -54,7 +54,7 @@ func (b Bilibili) CopyLiveStream( b.logger.Info("Copying live stream...") // blocking copy - n, err := common.CopyToFileWithBuffer(ctx, out, resp.Body, buffer, readChunkSize, false) + n, err := common.CopyToFileWithBuffer(ctx, out, resp.Body, buffer, false, uint(len(buffer)/readChunkSize)) if err != nil && !errors.Is(err, context.Canceled) { b.logger.Error("Stream copying was interrupted unexpectedly: %v", err) -- cgit v1.2.3