bastimeyer · GitHub

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.

Read the original on github.com ↗