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

blank line(empty line) parsing error #13

Open
younseunghyun opened this issue Apr 15, 2019 · 1 comment
Open

blank line(empty line) parsing error #13

younseunghyun opened this issue Apr 15, 2019 · 1 comment

Comments

@younseunghyun
Copy link

Hi. We currently use you're library for parsing srt, vtt format subtitles.

Thank you for sharing the code.

By the way, when you parsing the srt format file, empty line after CUE_TIMECODE CursorStatus is treated as error case.

But there are possible case that text of cue is blank.

Can you modify this algorithm to handle a blank line?

Thanks.

@viettranhoang
Copy link

viettranhoang commented Dec 16, 2020

Hi, I fixed it by adding these lines:

            if (cursorStatus == CursorStatus.CUE_TIMECODE && textLine.isEmpty()) {
                srtObject.addCue(cue);
                cue = null;
                cursorStatus = CursorStatus.NONE;
                continue;
            }

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

No branches or pull requests

2 participants