Skip to content

sub/sd_sbr: implement get_{text,lines}#17820

Draft
afishhh wants to merge 2 commits intompv-player:masterfrom
afishhh:sbr-sub-lines
Draft

sub/sd_sbr: implement get_{text,lines}#17820
afishhh wants to merge 2 commits intompv-player:masterfrom
afishhh:sbr-sub-lines

Conversation

@afishhh
Copy link
Copy Markdown
Contributor

@afishhh afishhh commented Apr 26, 2026

Requires afishhh/subrandr#169, submitting this earlier in case there are any concerns about the API exposed by subrandr here.

The reason get_text has to be stateful can be seen in some (yes, this only happens in some of them) hololive subs where they have translation + original karaoke on screen:

  • the first state of the karaoke line comes first in the file and ends up first in subrandr's list
  • the translation comes second (it will be under the first line)
  • the next karaoke state starts after the translation, this will cause the lines to switch places

Naturally this still swaps the lines after seeking into the middle of such a segment or playing the video backwards but at least they're stable :)

@afishhh
Copy link
Copy Markdown
Contributor Author

afishhh commented May 6, 2026

Going to release subrandr v1.3 with the required API soon.

The reason get_text has to be stateful

This might actually end up being a temporary solution since I intend to introduce an API specifically for "rendering" to text at which point get_text could just use that. Not happening for v1.3 though so for now this will have to do.

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.

1 participant