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

fix: level playlist parse error of ProgramDateTime #4498

Conversation

hongfeih-es
Copy link
Contributor

This PR will...

Fix level playlist parse error when #EXT-X-PROGRAM-DATE-TIME appear before #EXT-X-MAP

Why is this Pull Request needed?

When #EXT-X-PROGRAM-DATE-TIME appear before #EXT-X-MAP, rawProgramDateTime of currentInitSegment will be set:

frag.rawProgramDateTime = (' ' + result[5]).slice(1);

Then rawProgramDateTime of the following fragments will be set to same rawProgramDateTime:

if (currentInitSegment) {
frag.initSegment = currentInitSegment;
frag.rawProgramDateTime = currentInitSegment.rawProgramDateTime;
}

Thus, programDateTime will be set to wrong value in function assignProgramDateTime:

function assignProgramDateTime(frag, prevFrag) {
if (frag.rawProgramDateTime) {
frag.programDateTime = Date.parse(frag.rawProgramDateTime);

So currentInitSegment.rawProgramDateTime need to be cleared after set once.

Are there any points in the code the reviewer needs to double check?

No.

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.2.0 milestone Feb 2, 2022
@robwalch robwalch merged commit 6d56c30 into video-dev:master Feb 2, 2022
littlespex pushed a commit to cbsinteractive/hls.js that referenced this pull request Dec 9, 2022
Previously, top-level enums caused the generation of filenames like
"shaka.config.html#AutoShowText" instead of
"shaka.config.AutoShowText.html". This broke the generation of docs for
top-level enums (attached to a namespace instead of a class).

This adds support for these into our jsdoc template.

Related to PR video-dev#3421
@hongfeih-es hongfeih-es deleted the bugfix/level-playlist-parse-error-due-to-rawProgramDateTime-of-init-segment-not-reset branch April 26, 2023 01:44
@hongfeih-es hongfeih-es restored the bugfix/level-playlist-parse-error-due-to-rawProgramDateTime-of-init-segment-not-reset branch April 26, 2023 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants