Thanks to visit codestin.com
Credit goes to github.com

Skip to content

stream.dash: fix SegmentTemplate's BaseURL context#5194

Merged
gravyboat merged 1 commit into
streamlink:masterfrom
bastimeyer:stream/dash/baseurl-segmenttemplate
Feb 24, 2023
Merged

stream.dash: fix SegmentTemplate's BaseURL context#5194
gravyboat merged 1 commit into
streamlink:masterfrom
bastimeyer:stream/dash/baseurl-segmenttemplate

Conversation

@bastimeyer

Copy link
Copy Markdown
Member

Fixes #4586

Previously, when formatting init/media segment URLs of a SegmentTemplate, its own inherited base_url property was used, which does only work in MPD documents where the next BaseURL node is a child node of one of the SegmentTemplate's ancestor nodes, namely AdaptationSet, Period or MPD:

<MPD ...>
  <BaseURL>one</BaseURL>
  <Period ...>
    <BaseURL>two</BaseURL>
    <AdaptationSet>
      <BaseURL>three</BaseURL>
      <SegmentTemplate .../>
      <Representation .../>
    </AdaptationSet>
  </Period>
</MPD>

This left out potential BaseURL child-nodes in Representation nodes that are siblings of SegmentTemplate (and similar cases):

<MPD ...>
  <BaseURL>one</BaseURL>
  <Period ...>
    <BaseURL>two</BaseURL>
    <AdaptationSet>
      <BaseURL>three</BaseURL>
      <SegmentTemplate .../>
      <Representation ...>
        <BaseURL>four was ignored</BaseURL>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>

To fix the issue, just pass the resolved base_url from the Representation instance to the SegmentTemplate's segment generator, where the init/media URLs are formatted.

@gravyboat gravyboat merged commit e684913 into streamlink:master Feb 24, 2023
@bastimeyer bastimeyer deleted the stream/dash/baseurl-segmenttemplate branch February 24, 2023 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stream.dash: nested BaseURL resolving

2 participants