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: do not parse mpeg-ts files as typescript files #26958

Closed

Conversation

KnisterPeter
Copy link
Contributor

@KnisterPeter KnisterPeter commented Sep 7, 2018

MPEG-TS files consist of frames each 188 bytes long.
These files should not be parsed as typescript files
and therefore we look into the first 50 frames and
check if we find a 'valid' header.

Here's a checklist you might find useful.

  • There is an associated issue that is labeled
    'Bug' or 'help wanted' or is in the Community milestone
  • Code is up-to-date with the master branch
  • You've successfully run jake runtests locally
  • You've signed the CLA
  • There are new or updated unit tests validating the change

Fixes #21136

MPEG-TS files consist of frames each 188 bytes long.
These files should not be parsed as typescript files
and therefore we look into the first 50 frames and
check if we find a 'valid' header.

Closes microsoft#21136
@KnisterPeter
Copy link
Contributor Author

@mhegazy @RyanCavanaugh The tests are still missing here, but if you don't mind I would love to get some feedback if the direction of this fix is correct.

@RyanCavanaugh RyanCavanaugh added this to the Community milestone Sep 17, 2018
@RyanCavanaugh
Copy link
Member

Apologies for the delay here.

I think we need to optimize this for incurring the absolute minimum overhead in the common case where none of the files are MPEGs. Specifically, that means the order of operations should be:

  • Read the file as normal
  • If the length is enormous (20 MB?) then check for the signalling bytes
  • If the file is determined to be a transport stream, then fail in some reasonably graceful manner (doesn't have to be perfect since this should never be occurring except once by mistake)

@RyanCavanaugh RyanCavanaugh self-assigned this Jan 24, 2019
@RyanCavanaugh
Copy link
Member

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code Helper attempts to index MPEG-TS files in project and eats 100% cpu
2 participants