Skip to content

Commit

Permalink
修正排序问题
Browse files Browse the repository at this point in the history
  • Loading branch information
nilaoda committed Nov 29, 2022
1 parent b3cf21d commit a5c7522
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ public async Task<List<StreamSpec>> ExtractStreamsAsync(string rawText)
var initUrl = ParserUtil.CombineURL(segBaseUrl, initialization.Attribute("sourceURL")?.Value!);
var initRange = initialization.Attribute("range")?.Value;
streamSpec.Playlist.MediaInit = new MediaSegment();
streamSpec.Playlist.MediaInit.Index = -1; //便于排序
streamSpec.Playlist.MediaInit.Url = initUrl;
if (initRange != null)
{
Expand All @@ -253,6 +254,7 @@ public async Task<List<StreamSpec>> ExtractStreamsAsync(string rawText)
var initUrl = ParserUtil.CombineURL(segBaseUrl, initialization.Attribute("sourceURL")?.Value!);
var initRange = initialization.Attribute("range")?.Value;
streamSpec.Playlist.MediaInit = new MediaSegment();
streamSpec.Playlist.MediaInit.Index = -1; //便于排序
streamSpec.Playlist.MediaInit.Url = initUrl;
if (initRange != null)
{
Expand Down Expand Up @@ -312,6 +314,7 @@ public async Task<List<StreamSpec>> ExtractStreamsAsync(string rawText)
{
var initUrl = ParserUtil.ReplaceVars(ParserUtil.CombineURL(segBaseUrl, initialization), varDic);
streamSpec.Playlist.MediaInit = new MediaSegment();
streamSpec.Playlist.MediaInit.Index = -1; //便于排序
streamSpec.Playlist.MediaInit.Url = initUrl;
}
//处理分片
Expand Down
1 change: 1 addition & 0 deletions src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ private async Task<Playlist> ParseListAsync()
playlist.MediaInit = new MediaSegment()
{
Url = PreProcessUrl(ParserUtil.CombineURL(BaseUrl, ParserUtil.GetAttribute(line, "URI"))),
Index = -1, //便于排序
};
if (line.Contains("BYTERANGE"))
{
Expand Down
1 change: 1 addition & 0 deletions src/N_m3u8DL-RE.Parser/Extractor/MSSExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public async Task<List<StreamSpec>> ExtractStreamsAsync(string rawText)
streamSpec.Playlist.MediaInit = new MediaSegment();
if (!string.IsNullOrEmpty(codecPrivateData))
{
streamSpec.Playlist.MediaInit.Index = -1; //便于排序
streamSpec.Playlist.MediaInit.Url = $"hex://{codecPrivateData}";
}

Expand Down

0 comments on commit a5c7522

Please sign in to comment.