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

Use relative index matching for subtitle selection #4201

Merged

Conversation

nielsvanvelzen
Copy link
Member

When I rewrote the subtitle behavior I did test with media that had both embedded and external subtitles, and in those tests the server would always put all embedded tracks (including audio/video) before external tracks, keeping their indexes the same as you would find them sorted in when inspecting with ffprobe, mkvtoolnix and other tools.

However, this piece of shit API does not always do that. In fact, it can put the external tracks before internal tracks just for funs. This leaves a client literally unable to reliably map a media stream to tracks in their video engine. The hack I've implemented will take all the embedded/hls subtitle streams, filtering out everything else, and then calculate the index. Then does the same when selecting the ExoPlayer track. This should fix all the issues we've encountered (it does so for the media I tested with) but it's still unreliable because this will still fail if the server decided to fuck up the order of these tracks too.

Changes

  • Rewrite subtitle track matching for embedded/hls subtitle tracks to calculate the actual index locally

Issues

Fixes #4183
Maybe fixes #4182

@nielsvanvelzen nielsvanvelzen merged commit 2ba2b70 into jellyfin:master Nov 12, 2024
5 checks passed
@nielsvanvelzen nielsvanvelzen deleted the relative-subtitle-matching branch November 12, 2024 14:59
@The-Randalorian
Copy link
Contributor

Confirmed fixes #4182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selecting embedded subtitle track leads to different track being displayed PGS Subtitles Not Being Used
3 participants