Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wseymour15 opened this issue Aug 9, 2023 · 0 comments
Labels

Comments

@wseymour15
Copy link
Contributor

wseymour15 commented Aug 9, 2023

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: {...}
      }
    ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant