录制直播时,用户选了几个流就并发录几个

This commit is contained in:
nilaoda 2022-09-19 00:37:19 +08:00
parent ce112208d4
commit 80b6f85578
1 changed files with 6 additions and 1 deletions

View File

@ -602,8 +602,13 @@ namespace N_m3u8DL_RE.DownloadManager
var limit = DownloaderConfig.MyOptions.LiveRecordLimit; var limit = DownloaderConfig.MyOptions.LiveRecordLimit;
if (limit != TimeSpan.MaxValue) if (limit != TimeSpan.MaxValue)
Logger.WarnMarkUp($"[darkorange3_1]{ResString.liveLimit}{GlobalUtil.FormatTime((int)limit.Value.TotalSeconds)}[/]"); Logger.WarnMarkUp($"[darkorange3_1]{ResString.liveLimit}{GlobalUtil.FormatTime((int)limit.Value.TotalSeconds)}[/]");
//录制直播时,用户选了几个流就并发录几个
var options = new ParallelOptions()
{
MaxDegreeOfParallelism = SelectedSteams.Count
};
//并发下载 //并发下载
await Parallel.ForEachAsync(dic, async (kp, _) => await Parallel.ForEachAsync(dic, options, async (kp, _) =>
{ {
var task = kp.Value; var task = kp.Value;
var list = new BufferBlock<List<MediaSegment>>(); var list = new BufferBlock<List<MediaSegment>>();