Skip to content

Duplicate Playlist Entries with BaseURL tags at different levels of the Manifest #175

Open
@wseymour15

Description

@wseymour15

There are occurrences in the inheritAttributes functionality where this representationInfo array contains undesired duplicates. This generally occurs when there are multiple BaseURL nodes that are direct children of the MPD node. When we attempt to resolve URLs from a combination of the parent BaseURL and a child BaseURL, and the value does not resolve, we end up returning the child BaseURL multiple times. We need to determine a way to remove these duplicates in a safe way.

See: #17 (comment)

Example Input (Note that there are multiple BaseURLs as direct children of the MPD tag)

<MPD type="dyanmic">
    <BaseURL serviceLocation="alpha">https://cdn1.example.com/</BaseURL>
    <BaseURL serviceLocation="beta">https://cdn2.example.com/</BaseURL>
    <Period start="PT0S">
      ...
      <AdaptationSet mimeType="text/vtt" lang="en">
        <Representation bandwidth="256" id="en">
          <BaseURL>https://example.com/en.vtt</BaseURL>
        </Representation>
      </AdaptationSet>
    </Period>
  </MPD>

Current Actual RepresentationInfo

representationInfo: [
      {
        attributes: {
          baseUrl: 'https://cdn1.example.com/',
          ...
        },
        segmentInfo: {...}
      },
      {
        attributes: {
          baseUrl: 'https://cdn2.example.com/',
          ... 
        },
        segmentInfo: {...}
      },
      {
        attributes: {
          baseUrl: 'https://example.com/en.vtt',
          ... 
        },
        segmentInfo: {...}
      },
      {
        attributes: {
          baseUrl: 'https://example.com/en.vtt',
          ...
        },
        segmentInfo: {...}
      }
    ]

Expected (Notice there is one less entry than the last)

representationInfo: [
      {
        attributes: {
          baseUrl: 'https://cdn1.example.com/',
          ...
        },
        segmentInfo: {...}
      },
      {
        attributes: {
          baseUrl: 'https://cdn2.example.com/',
          ... 
        },
        segmentInfo: {...}
      },
      {
        attributes: {
          baseUrl: 'https://example.com/en.vtt',
          ... 
        },
        segmentInfo: {...}
      }
    ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions