优化直播字幕时间轴处理

This commit is contained in:
nilaoda 2022-11-28 16:32:15 +08:00
parent 31482c8d34
commit 386c2bb46a
1 changed files with 4 additions and 4 deletions

View File

@ -414,7 +414,7 @@ namespace N_m3u8DL_RE.DownloadManager
var first = true; var first = true;
foreach (var seg in keys) foreach (var seg in keys)
{ {
var vtt = MP4TtmlUtil.ExtractFromTTML(FileDic[seg]!.ActualFilePath, 0, first ? baseTimestamp : 0); var vtt = MP4TtmlUtil.ExtractFromTTML(FileDic[seg]!.ActualFilePath, 0, baseTimestamp);
//手动计算MPEGTS //手动计算MPEGTS
if (currentVtt.MpegtsTimestamp == 0 && vtt.MpegtsTimestamp == 0) if (currentVtt.MpegtsTimestamp == 0 && vtt.MpegtsTimestamp == 0)
{ {
@ -429,7 +429,7 @@ namespace N_m3u8DL_RE.DownloadManager
{ {
foreach (var seg in keys) foreach (var seg in keys)
{ {
var vtt = MP4TtmlUtil.ExtractFromTTML(FileDic[seg]!.ActualFilePath, 0); var vtt = MP4TtmlUtil.ExtractFromTTML(FileDic[seg]!.ActualFilePath, 0, baseTimestamp);
//手动计算MPEGTS //手动计算MPEGTS
if (currentVtt.MpegtsTimestamp == 0 && vtt.MpegtsTimestamp == 0) if (currentVtt.MpegtsTimestamp == 0 && vtt.MpegtsTimestamp == 0)
{ {
@ -460,7 +460,7 @@ namespace N_m3u8DL_RE.DownloadManager
var first = true; var first = true;
foreach (var seg in keys) foreach (var seg in keys)
{ {
var vtt = MP4TtmlUtil.ExtractFromMp4(FileDic[seg]!.ActualFilePath, 0, first ? baseTimestamp : 0); var vtt = MP4TtmlUtil.ExtractFromMp4(FileDic[seg]!.ActualFilePath, 0, baseTimestamp);
//手动计算MPEGTS //手动计算MPEGTS
if (currentVtt.MpegtsTimestamp == 0 && vtt.MpegtsTimestamp == 0) if (currentVtt.MpegtsTimestamp == 0 && vtt.MpegtsTimestamp == 0)
{ {
@ -475,7 +475,7 @@ namespace N_m3u8DL_RE.DownloadManager
{ {
foreach (var seg in keys) foreach (var seg in keys)
{ {
var vtt = MP4TtmlUtil.ExtractFromMp4(FileDic[seg]!.ActualFilePath, 0); var vtt = MP4TtmlUtil.ExtractFromMp4(FileDic[seg]!.ActualFilePath, 0, baseTimestamp);
//手动计算MPEGTS //手动计算MPEGTS
if (currentVtt.MpegtsTimestamp == 0 && vtt.MpegtsTimestamp == 0) if (currentVtt.MpegtsTimestamp == 0 && vtt.MpegtsTimestamp == 0)
{ {