Skip to content

Fix cue render order for ass/ssa. - #2137

Merged
copybara-service[bot] merged 14 commits into
androidx:mainfrom
peerless2012:fix_cue_order
May 9, 2025
Merged

copybara-service[bot] merged 14 commits into
androidx:mainfrom
peerless2012:fix_cue_order

Conversation

@peerless2012

Copy link
Copy Markdown
Contributor

This should fix #2124

  • Add layer in cue and output.
  • Add layer support for ssa parser.

@tonihei

tonihei commented Feb 21, 2025

Copy link
Copy Markdown
Collaborator

@icbaker Could you take a look? Thanks!

Comment thread libraries/common/src/main/java/androidx/media3/common/text/Cue.java Outdated
Comment thread libraries/common/src/main/java/androidx/media3/common/text/Cue.java Outdated
Comment thread libraries/ui/src/main/java/androidx/media3/ui/SubtitlePainter.java Outdated
@icbaker icbaker linked an issue Feb 25, 2025 that may be closed by this pull request
1 task
@peerless2012
peerless2012 requested a review from icbaker February 26, 2025 16:38
@peerless2012

Copy link
Copy Markdown
Contributor Author

@icbaker hello, please make a review for the new commit, and hope this pr can merge to 1.6.0 final release.

@peerless2012
peerless2012 marked this pull request as draft March 25, 2025 02:06
@peerless2012
peerless2012 marked this pull request as ready for review March 25, 2025 02:07
@icbaker

icbaker commented Apr 29, 2025

Copy link
Copy Markdown
Collaborator

Please can you add some tests for this?

I suggest:

  1. Some parsing tests in SsaParserTest (including negative & unparseable layer values) - assert that the right value ends up in Cue.zIndex
  2. An end-to-end test in SubtitlePlaybackTest? This will cover both your parsing code and the re-ordering in the CueGroup constructor.

For (2) I suggest you craft an SSA test file that has cues overlapping in time with different layer values, to demonstrate why the re-ordering has to be done 'outside' SsaParser.

@peerless2012

Copy link
Copy Markdown
Contributor Author

I add parseLayer and parseInvalidLayer in SsaParserTest to cover the layer value in ssa.

How can I add a test in SubtitlePlaybackTest? I have no idea.

@icbaker

icbaker commented May 8, 2025

Copy link
Copy Markdown
Collaborator

Thanks for adding the tests to SsaParserTest, I've added SsaPlaybackTest to cover the layer-based re-ordering inside CueGroup.

@icbaker

icbaker commented May 8, 2025

Copy link
Copy Markdown
Collaborator

I'm going to send this for internal review now. You may see some more commits being added as I make changes in response to review feedback. Please refrain from pushing any more substantive changes as it will complicate the internal review - thanks!

@peerless2012

Copy link
Copy Markdown
Contributor Author

I'm going to send this for internal review now. You may see some more commits being added as I make changes in response to review feedback. Please refrain from pushing any more substantive changes as it will complicate the internal review - thanks!

Thanks a lot for your help. 🫶

@copybara-service
copybara-service Bot merged commit 909b560 into androidx:main May 9, 2025
@peerless2012
peerless2012 deleted the fix_cue_order branch May 9, 2025 14:51
@icbaker icbaker mentioned this pull request May 9, 2025
1 task
@androidx androidx locked and limited conversation to collaborators Jul 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ASS render in a wrong order.

3 participants