-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
Rewrite all subtitle behavior #4094
Rewrite all subtitle behavior #4094
Conversation
@@ -31,6 +36,99 @@ | |||
} | |||
} | |||
|
|||
@OptIn(UnstableApi::class) | |||
@JvmOverloads | |||
fun PlaybackController.setSubtitleIndex(index: Int, force: Boolean = false) { |
Check warning
Code scanning / detekt
One method should have one responsibility. Long methods tend to handle many things at once. Prefer smaller methods to make them easier to understand. Warning
@@ -31,6 +36,99 @@ | |||
} | |||
} | |||
|
|||
@OptIn(UnstableApi::class) | |||
@JvmOverloads | |||
fun PlaybackController.setSubtitleIndex(index: Int, force: Boolean = false) { |
Check warning
Code scanning / detekt
Prefer splitting up complex methods into smaller, easier to test methods. Warning
|
||
public GetPlaybackInfoResponse(PlaybackManager playbackManager, DeviceInfo deviceInfo, ApiClient apiClient, AudioOptions options, Response<StreamInfo> response, boolean isVideo, Long startPositionTicks) { | ||
public GetPlaybackInfoResponse(PlaybackManager playbackManager, DeviceInfo deviceInfo, ApiClient apiClient, AudioOptions options, Response<StreamInfo> response, boolean isVideo) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
|
||
public GetPlaybackInfoResponse(PlaybackManager playbackManager, DeviceInfo deviceInfo, ApiClient apiClient, AudioOptions options, Response<StreamInfo> response, boolean isVideo, Long startPositionTicks) { | ||
public GetPlaybackInfoResponse(PlaybackManager playbackManager, DeviceInfo deviceInfo, ApiClient apiClient, AudioOptions options, Response<StreamInfo> response, boolean isVideo) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
|
||
public GetPlaybackInfoResponse(PlaybackManager playbackManager, DeviceInfo deviceInfo, ApiClient apiClient, AudioOptions options, Response<StreamInfo> response, boolean isVideo, Long startPositionTicks) { | ||
public GetPlaybackInfoResponse(PlaybackManager playbackManager, DeviceInfo deviceInfo, ApiClient apiClient, AudioOptions options, Response<StreamInfo> response, boolean isVideo) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
|
||
public GetPlaybackInfoResponse(PlaybackManager playbackManager, DeviceInfo deviceInfo, ApiClient apiClient, AudioOptions options, Response<StreamInfo> response, boolean isVideo, Long startPositionTicks) { | ||
public GetPlaybackInfoResponse(PlaybackManager playbackManager, DeviceInfo deviceInfo, ApiClient apiClient, AudioOptions options, Response<StreamInfo> response, boolean isVideo) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
|
||
public GetPlaybackInfoResponse(PlaybackManager playbackManager, DeviceInfo deviceInfo, ApiClient apiClient, AudioOptions options, Response<StreamInfo> response, boolean isVideo, Long startPositionTicks) { | ||
public GetPlaybackInfoResponse(PlaybackManager playbackManager, DeviceInfo deviceInfo, ApiClient apiClient, AudioOptions options, Response<StreamInfo> response, boolean isVideo) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
|
||
@Nullable | ||
private CustomPlaybackOverlayFragment mFragment; | ||
private Boolean spinnerOff = false; | ||
|
||
private VideoOptions mCurrentOptions; | ||
private int mDefaultSubIndex = -1; | ||
protected VideoOptions mCurrentOptions; |
Check notice
Code scanning / Android Lint
Unknown nullness Note
return flags; | ||
} | ||
|
||
public void setMediaStreamInfo(ApiClient api, StreamInfo streamInfo) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
return flags; | ||
} | ||
|
||
public void setMediaStreamInfo(ApiClient api, StreamInfo streamInfo) { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
app/src/main/java/org/jellyfin/androidtv/ui/playback/VideoManager.java
Outdated
Show resolved
Hide resolved
d30ff5c
to
50e2a95
Compare
Findings Server: 10.10.0 srt: pgs: ass: |
External PGS should be fixed now. The codec->mime mapping failed because the server returns ASS/SSA should also be fixed. When the subtitle track was default/foced and the video was direct playing the subtitle track would be embedded, I missed a case where the ExoPlayer needed to be disabled. (there as a check to only force-update the ExoPlayer subtitle track when a subtitle was selected). Thanks for testing! |
c8566c7
to
3a799d2
Compare
New findings: ass: pgs: |
First one fixed with #4098. For the second one it feels like there is an issue with androidx.media3 that I need some more time to investigate. It wouldn't show subtitles for me whenever there was more then one pgs track. |
I just noticed that the index is off for PGS. In the file: When I select track 1, it displays the sdh pgs track (track 2). Selecting track 2 leads to no subtitles being displayed. |
In #3825 I made the initial changes to no longer require external subtitles. This came with a few issues; there was no longer support for external subtitles, switching subtitles didn't work a lot of times and the app didn't track which subtitles were playing properly. This pull request aims to fix all the issues by rewriting the subtitle logic.
The new logic relies on the server providing the delivery method for subs. For example, when transcoding the delivery method is set to HLS but on direct-play it is Embedded or External. The client will then decide the appropriate method to loading subtitles based on that information.
In my testing everything appears to work correctly but I'd appreciate some additional testing for:
There should be sufficient logging to troubleshoot issues.
Changes
Issues