-
Notifications
You must be signed in to change notification settings - Fork 513
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
WebVTT: END_OF_STREAM error when there is no, or only one, cue #1018
Comments
@kqyang @joeyparrish any thoughts on this ? where in the packager is it exiting out ?
And with just this small WEBVTT file it just exits out instead of processing it correctly as a small VTT file with a single cue.
|
Good question. I wonder if we have a really basic edge case bug. If you add an empty line or two to the end of the file, does that make a difference? |
@joeyparrish Yes, it does make a difference in the case of a single cue (sample2). Processing works when there are two newlines. (It doesn't seem to make a difference in the header-only case.) |
I would bet that our VTT parser is just too strict about the end of the input string. See if you can modify packager/media/formats/webvtt/webvtt_parser.cc and add a new test case to cover this. We would love to have your contribution. |
Try this PR @joeyparrish @dvoracek-slub |
While Parsing cue body check for the block size. If it's the last block do not error if it doesn't have a newline. Fixes #1018
While Parsing cue body check for the block size. If it's the last block do not error if it doesn't have a newline. Fixes shaka-project#1018
While Parsing cue body check for the block size. If it's the last block do not error if it doesn't have a newline. Fixes shaka-project#1018
System info
Operating System: any
Shaka Packager Version: e1b0c7c (current master)
Issue and steps to reproduce the problem
When processing a WebVTT file that either does not contain a cue, or ends immediately after the first cue, Packager rejects it with an "END_OF_STREAM" error. The sample files are taken from the parser unit tests.
Packager Command:
What is the expected result?
The files should be processed without error, and output files should be generated as appropriate. (When there is no cue, it may be viable to not generate any output. That, at least, seems to be the current behavior when there are only zero-length cues.)
What happens instead?
I receive the following message:
From what I understood in the code, the issue seems to lie in the interaction between Demuxer and WebVttParser. When the end of the input file is reached before
Demuxer::ParserInitEvent
has been called (either because there is no cue, or because the parser doesn't know yet that the cue is finished), this is incorrectly treated as an error inDemuxer::Run
.Sample Files
sample1.vtt
sample2.vtt (NOTE: single newline at end of file)
The text was updated successfully, but these errors were encountered: