diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs index 2da0ee9..620c916 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs @@ -741,7 +741,22 @@ namespace N_m3u8DL_RE.DownloadManager if (index > -1) { - streamSpec.Playlist!.MediaParts[0].MediaSegments = streamSpec.Playlist!.MediaParts[0].MediaSegments.Skip(index + 1).ToList(); + //修正Index + var list = streamSpec.Playlist!.MediaParts[0].MediaSegments.Skip(index + 1).ToList(); + if (list.Count > 0) + { + var newMin = list.Min(s => s.Index); + var oldMax = streamSpec.Playlist!.MediaParts[0].MediaSegments.Max(s => s.Index); + if (newMin < oldMax) + { + var offset = oldMax - newMin + 1; + foreach (var item in list) + { + item.Index += offset; + } + } + } + streamSpec.Playlist!.MediaParts[0].MediaSegments = list; } }