summaryrefslogtreecommitdiff
path: root/recording
diff options
context:
space:
mode:
Diffstat (limited to 'recording')
-rw-r--r--recording/config.go2
-rw-r--r--recording/runner.go10
2 files changed, 2 insertions, 10 deletions
diff --git a/recording/config.go b/recording/config.go
index ff3ae2a..7dbf189 100644
--- a/recording/config.go
+++ b/recording/config.go
@@ -22,7 +22,7 @@ type TransportConfig struct {
type DownloadConfig struct {
SaveDirectory string `mapstructure:"save_directory"`
- DiskWriteBufferBytes int `mapstructure:"disk_write_buffer_bytes"`
+ DiskWriteBufferBytes int64 `mapstructure:"disk_write_buffer_bytes"`
UseSpecialExtNameBeforeFinishing bool `mapstructure:"use_special_ext_name_when_downloading"`
}
diff --git a/recording/runner.go b/recording/runner.go
index 7fdffac..47c6764 100644
--- a/recording/runner.go
+++ b/recording/runner.go
@@ -26,7 +26,6 @@ type TaskResult struct {
Error error
}
-const kReadChunkSize = 1024 * 1024
const kSpecialExtName = "partial"
var errLiveEnded = NewRecoverableTaskError("live is ended", nil)
@@ -310,16 +309,9 @@ func record(
defer func() { _ = file.Close() }()
writeBufferSize := task.Download.DiskWriteBufferBytes
- if writeBufferSize < kReadChunkSize {
- writeBufferSize = kReadChunkSize
- }
- if mod := writeBufferSize % kReadChunkSize; mod != 0 {
- writeBufferSize += kReadChunkSize - mod
- }
- writeBuffer := make([]byte, writeBufferSize)
logger.Info("Write buffer size: %v byte", writeBufferSize)
logger.Info("Recording live stream to file \"%v\"...", filePath)
- err = bi.CopyLiveStream(ctx, task.RoomId, streamSource, file, writeBuffer, kReadChunkSize)
+ err = bi.CopyLiveStream(ctx, task.RoomId, streamSource, file, writeBufferSize)
if errors.Is(err, context.Canceled) || err == nil {
return err
}