From 9722079c65b2da94bab57da3d8ebc4d532e3d975 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Sun, 26 Jun 2022 20:17:14 +0800 Subject: [PATCH] bug fix --- src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor.cs b/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor.cs index 65bb61f..fa8742d 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor.cs @@ -253,10 +253,10 @@ namespace N_m3u8DL_RE.Parser.Extractor if (!representationMsInfo.ContainsKey("TotalNumber") && representationMsInfo.ContainsKey("SegmentDuration")) { segmentDuration = DoubleOrNull(representationMsInfo["SegmentDuration"].GetValue(), representationMsInfo["Timescale"].GetValue()); - representationMsInfo["TotalNumber"] = (int)Math.Ceiling(periodDuration.TotalSeconds / segmentDuration); + representationMsInfo["TotalNumber"] = (long)Math.Ceiling(periodDuration.TotalSeconds / segmentDuration); } var fragments = new JsonArray(); - for (int i = representationMsInfo["StartNumber"].GetValue(); i < representationMsInfo["StartNumber"].GetValue() + representationMsInfo["TotalNumber"].GetValue(); i++) + for (int i = representationMsInfo["StartNumber"].GetValue(); i < representationMsInfo["StartNumber"].GetValue() + representationMsInfo["TotalNumber"].GetValue(); i++) { var segUrl = ""; if (mediaTemplate.Contains("{0:D")) @@ -626,12 +626,12 @@ namespace N_m3u8DL_RE.Parser.Extractor var sE = segmentTimeline.SelectNodes("ns:S", nsMgr); if (sE?.Count > 0) { - MultisegmentInfo["TotalNumber"] = 0; + MultisegmentInfo["TotalNumber"] = 0L; var SList = new JsonArray(); foreach (XmlElement s in sE) { var r = string.IsNullOrEmpty(s.GetAttribute("r")) ? 0 : Convert.ToInt64(s.GetAttribute("r")); - MultisegmentInfo["TotalNumber"] = MultisegmentInfo["TotalNumber"]?.GetValue() + 1 + r; + MultisegmentInfo["TotalNumber"] = MultisegmentInfo["TotalNumber"]?.GetValue() + 1 + r; SList.Add(new JsonObject() { ["t"] = string.IsNullOrEmpty(s.GetAttribute("t")) ? 0 : Convert.ToInt64(s.GetAttribute("t")),