From 4cc5fd6d35e0b5a2bd1c1679d29fa41fef4daad9 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Tue, 11 Oct 2022 20:05:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dvtt=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=BD=B4=E9=97=AE=E9=A2=98=20fix=20#41?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs | 2 +- src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs | 2 +- src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs index 691e80c..da93eb8 100644 --- a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs +++ b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs @@ -433,7 +433,7 @@ namespace N_m3u8DL_RE.CommandLine Environment.Exit(0); } - var rootCommand = new RootCommand("N_m3u8DL-RE (Beta version) 20220928") + var rootCommand = new RootCommand("N_m3u8DL-RE (Beta version) 20221011") { Input, TmpDir, SaveDir, SaveName, BaseUrl, ThreadCount, DownloadRetryCount, AutoSelect, SkipMerge, SkipDownload, CheckSegmentsCount, BinaryMerge, DelAfterDone, WriteMetaJson, AppendUrlParams, ConcurrentDownload, Headers, /**SavePattern,**/ SubOnly, SubtitleFormat, AutoSubtitleFix, diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs index 56f77ab..29f18e8 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs @@ -345,7 +345,7 @@ namespace N_m3u8DL_RE.DownloadManager //手动计算MPEGTS if (finalVtt.MpegtsTimestamp == 0 && vtt.MpegtsTimestamp == 0) { - vtt.MpegtsTimestamp = 90 * (long)(seg.Duration * 1000) * seg.Index; + vtt.MpegtsTimestamp = 90000 * (long)keys.Where(s => s.Index < seg.Index).Sum(s => s.Duration); } if (first) { diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs index cbc93be..3733300 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs @@ -322,7 +322,7 @@ namespace N_m3u8DL_RE.DownloadManager //手动计算MPEGTS if (currentVtt.MpegtsTimestamp == 0 && vtt.MpegtsTimestamp == 0) { - vtt.MpegtsTimestamp = 90 * (long)(seg.Duration * 1000) * seg.Index; + vtt.MpegtsTimestamp = 90000 * (long)keys.Where(s => s.Index < seg.Index).Sum(s => s.Duration); } if (firstSub) {