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

Several FRAG_PARSING_ERROR errors emitted #4469

Closed
albertdaurell opened this issue Dec 24, 2021 · 0 comments
Closed

Several FRAG_PARSING_ERROR errors emitted #4469

albertdaurell opened this issue Dec 24, 2021 · 0 comments
Labels
Milestone

Comments

@albertdaurell
Copy link
Contributor

albertdaurell commented Dec 24, 2021

Is your feature request related to a problem? Please describe.

Hi all, a long time ago we detected a unique session that emitted several FRAG_PARSING_ERROR events for the same ts file.
While checking the code I found that this error is sent inside a loop

See src/demux/tsdemuxer.ts#L275:

for (let start = syncOffset; start < len; start += 188) {
  if (data[start] === 0x47) {
    ...
  } else {
    this.observer.emit(Events.ERROR, Events.ERROR, {
      type: ErrorTypes.MEDIA_ERROR,
      details: ErrorDetails.FRAG_PARSING_ERROR,
      fatal: false,
      reason: 'TS packet did not start with 0x47',
    });
  }
}

So, if there is an error while parsing the packet for sure other start offsets can have same issue.

Describe the solution you'd like

A possible solution ( see pull #4481 ) could be report only an error with the total of errors found, something like:

let tsPacketErrors = 0;
for (let start = syncOffset; start < len; start += 188) {
  if (data[start] === 0x47) {
    ...
  }
  else {
    tsPacketErrors++;
  }
}

if (tsPacketErrors > 0) {
  this.observer.emit(Events.ERROR, Events.ERROR, {
    type: ErrorTypes.MEDIA_ERROR,
    details: ErrorDetails.FRAG_PARSING_ERROR,
    fatal: false,
    reason: `Found ${tsPacketErrors} TS packet/s that did not start with 0x47`,
  });
}

Additional context

Pull created #4481

@albertdaurell albertdaurell added Feature proposal Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Dec 24, 2021
@albertdaurell albertdaurell changed the title A lot of FRAG_PARSING_ERROR errors emitted Several FRAG_PARSING_ERROR errors emitted Dec 24, 2021
@robwalch robwalch added Bug and removed Feature proposal Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Jan 13, 2022
@robwalch robwalch added this to the 1.1.3 milestone Jan 13, 2022
littlespex pushed a commit to cbsinteractive/hls.js that referenced this issue Dec 9, 2022
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

2 participants