summaryrefslogtreecommitdiff
path: root/bilibili/streaming.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-09-15 00:58:10 +0800
committerKeuin <[email protected]>2022-09-15 01:19:02 +0800
commit4e742159af79cf0f6a14da630a362a0344a5a121 (patch)
tree11b09ae5100158198906a69c9e8214d8286d3893 /bilibili/streaming.go
parent1a2cd1e08b5f63814acbddf453be523fcca8bad3 (diff)
Make copy and write IO operations async.
Diffstat (limited to 'bilibili/streaming.go')
-rw-r--r--bilibili/streaming.go2
1 files changed, 1 insertions, 1 deletions
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)