优化多Period处理逻辑
This commit is contained in:
parent
3bb4c4cb0c
commit
711bbb02a4
|
@ -456,7 +456,11 @@ namespace N_m3u8DL_RE.Parser.Extractor
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//点播,这种情况作为新的part出现
|
//点播,这种情况如果URL不同则作为新的part出现,否则仅把时间加起来
|
||||||
|
var url1 = streamList[_index].Playlist!.MediaParts.Last().MediaSegments.Last().Url;
|
||||||
|
var url2 = streamSpec.Playlist.MediaParts[0].MediaSegments.LastOrDefault()?.Url;
|
||||||
|
if (url1 != url2)
|
||||||
|
{
|
||||||
var startIndex = streamList[_index].Playlist!.MediaParts.Last().MediaSegments.Last().Index + 1;
|
var startIndex = streamList[_index].Playlist!.MediaParts.Last().MediaSegments.Last().Index + 1;
|
||||||
var enumerator = streamSpec.Playlist.MediaParts[0].MediaSegments.GetEnumerator();
|
var enumerator = streamSpec.Playlist.MediaParts[0].MediaSegments.GetEnumerator();
|
||||||
while (enumerator.MoveNext())
|
while (enumerator.MoveNext())
|
||||||
|
@ -468,6 +472,11 @@ namespace N_m3u8DL_RE.Parser.Extractor
|
||||||
MediaSegments = streamSpec.Playlist.MediaParts[0].MediaSegments
|
MediaSegments = streamSpec.Playlist.MediaParts[0].MediaSegments
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
streamList[_index].Playlist!.MediaParts.Last().MediaSegments.Last().Duration += streamSpec.Playlist.MediaParts[0].MediaSegments.Sum(x => x.Duration);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue