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

Error thrown in CEA 708 window when indicated row count in packet is 15 #3634

Closed
pcruiksh opened this issue Sep 14, 2021 · 10 comments · Fixed by #4757
Closed

Error thrown in CEA 708 window when indicated row count in packet is 15 #3634

pcruiksh opened this issue Sep 14, 2021 · 10 comments · Fixed by #4757
Assignees
Labels
component: captions/subtitles The issue involves captions or subtitles priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@pcruiksh
Copy link
Contributor

Have you read the FAQ and checked for duplicate open issues?
Yes

What version of Shaka Player are you using?
3.2.0

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from master?
Yes

Are you using the demo app or your own custom app?
Custom

If custom app, can you reproduce the issue using our demo app?
N/A

What browser and OS are you using?
MacOS 11.5.2 + Chrome 92

For embedded devices (smart TVs, etc.), what model and firmware version are you using?

What are the manifest and license server URIs?
N/A

What configuration are you using? What is the output of player.getConfiguration()?
N/A

What did you do?
Play content with embedded captions

What did you expect to happen?
Captions display and content plays correctly

What actually happened?
A type error from Cea708Window.setCharacter is thrown: cannot set property of undefined

The CEA 708 spec seems to allow for a max row count of 15 which is reflected in the number of rows created in a cea 708 window instance (indexed 0-14). I see that the spec specifies you should add 1 to the window row count , which is done when the row count byte is read from the packet (cea708_service.js, line 594). This creates a situation where if the indicated row count is 15, a row count of 16 is defined on the window, which means a carriage return allows the row index pointer to be moved to a non-existent index of the memory array (as only 0-14 are created initially) since the row index is still less than the configured row count. This causes a subsequent setCharacter() operation to throw.

@avelad
Copy link
Member

avelad commented Sep 15, 2021

@pcruiksh Do you have a stream with the error?

@pcruiksh
Copy link
Contributor Author

@avelad I am following up with our content team to see if I can get a piece of content in the clear, and to see if I am actually allowed to share any of our content in the first place. May I ask if content sent to [email protected] is only distributed within google?

@avelad
Copy link
Member

avelad commented Sep 15, 2021

I am not a member of the ShakaPlayer team, I just wanted to help solve this problem faster. If you send it to that mailing list, as far as I know, only the ShakaPlayer team (no one else from google) has access.

@avelad
Copy link
Member

avelad commented Sep 15, 2021

@joeyparrish Can you confirm what I have put about the mailing list?

@theodab
Copy link
Contributor

theodab commented Sep 15, 2021

That is correct. The group is configured so that only the members of the group (e.g. the Shaka Player team) can view the messages within it.

@TheModMaker
Copy link
Contributor

Can you please send us some sample content? The mailing list ([email protected]) is private and we won't share it outside the team.

@TheModMaker TheModMaker added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Sep 20, 2021
@pcruiksh
Copy link
Contributor Author

pcruiksh commented Sep 21, 2021

@TheModMaker Sorry for the slow response. I am unable to send you the specific content we identified that exhibits the issue but I can break it down more granularly (bearing in mind my flaky knowledge of the spec).

The row count byte can indicate a value in a range from 0-15, and the spec specifies you add 1 to this value when you define the properties of the window in your decoder.
https://github.com/google/shaka-player/blob/3f822d81221ff7c4d2ee2487b0eca5c4791d7059/lib/cea/cea708_service.js#L594

I'm not really clear why that is the case but in the example where that byte indicates a row count of 15, and we define a window row count of 16 per the spec, shaka.cea.Cea708Window.MAX_ROWS needs to be 16. Otherwise we are declaring we have 16 rows but creating an array indexed 0-14. The result is that the row pointer is eligible to be moved to index 15 which doesn't exist:
https://github.com/google/shaka-player/blob/3f822d81221ff7c4d2ee2487b0eca5c4791d7059/lib/cea/cea708_window.js#L269-L278

This then creates a TypeError when setCharacter is called when the window is at that row since this.memory_[this.row_] is undefined (out of bounds):
https://github.com/google/shaka-player/blob/3f822d81221ff7c4d2ee2487b0eca5c4791d7059/lib/cea/cea708_window.js#L190-L203

Currently our content works just fine if I simply increase MAX_ROWS but I am not sure if this is an "appropriate" solution, or if maybe this is a content issue.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Sep 21, 2021
@TheModMaker TheModMaker added type: bug Something isn't working correctly component: captions/subtitles The issue involves captions or subtitles and removed needs triage labels Sep 21, 2021
@TheModMaker TheModMaker added this to the v3.3 milestone Sep 21, 2021
@theodab theodab added the priority: P2 Smaller impact or easy workaround label Sep 30, 2021
@avelad avelad modified the milestones: v3.3, v4.1 May 4, 2022
@avelad avelad modified the milestones: v4.1, v4.2 Jun 3, 2022
@avelad avelad modified the milestones: v4.2, v4.3 Aug 17, 2022
@avelad avelad modified the milestones: v4.3, v4.4 Nov 11, 2022
@avelad
Copy link
Member

avelad commented Nov 24, 2022

@pcruiksh I'm working on many fix and features for CEA in the Shaka, if you can share your stream to me, I can work on a fix for it. Thanks!

@avelad
Copy link
Member

avelad commented Nov 24, 2022

I am reading on Wikipedia that the rows range is 0-15 so MAX_ROWS needs to be 16. Thanks for found it!

Info: https://en.wikipedia.org/wiki/CTA-708

@avelad avelad self-assigned this Nov 24, 2022
@avelad
Copy link
Member

avelad commented Nov 24, 2022

I'll work on a PR to fix it. Thanks!

theodab pushed a commit that referenced this issue Nov 28, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jan 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: captions/subtitles The issue involves captions or subtitles priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants