Skip to content

Commit

Permalink
fix bug about BaseURL
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfish-shogi committed May 2, 2023
1 parent 457f528 commit 6259248
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/dash.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,16 @@ func (m *Manifest) EachSegments(handle func(*DASHSegment) (cont bool)) error {
return err
}
for _, period := range m.Periods {
baseURL := baseURL
if period.BaseURL != "" {
baseURL, err = url.ResolveReference(baseURL, period.BaseURL)
}
for _, as := range period.AdaptationSets {
for _, rep := range as.Representations {
baseURL := baseURL
if rep.BaseURL != nil {
baseURL, err = url.ResolveReference(baseURL, *rep.BaseURL)
}
if as.SegmentTemplate != nil {
cont, err := visitSegmentsBySegmentTimeline(baseURL, as.SegmentTemplate, period, as, rep, handle)
if err != nil || !cont {
Expand Down

0 comments on commit 6259248

Please sign in to comment.