fix: always respect manual subtitle and audio selections#509
Open
mattsigal wants to merge 1 commit into
Open
Conversation
…and direct streaming - Pass selected subtitle and audio track indices explicitly in queryParameters for getPlaybackInfo requests in Jellyfin and Emby APIs to ensure server transcodes and initializes playback sessions with the chosen streams. - Preserves track overrides when transitioning from a preroll to the main media item by bypassing translateTrackSelectionsForNewItem when overrides are applied. - Implements a robust Uri-based query parameter replacement in MediaStreamResolver.applyStreamIndices, matching both camelCase and PascalCase variations. - Route and apply track selections in PlaybackManager during direct stream (remuxing) bringup in addition to transcoding. - Implement pending track selection queuing in native android Media3VideoView to handle race conditions where tracks are changed before they are fully loaded. - Lift action buttons' selected track index states to the persistent ItemDetailViewModel to prevent resets during screen unmounting/viewmodel reloads. - Fallback to streams marked as default when user's preferred default audio or subtitle settings are empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Finally resolves the issue where user-selected subtitle and audio tracks on the details screen did not persist during server-side transcoding, direct streaming (remuxing), or when transitioning from a preroll video to the main feature video.
Related Issues
Link related issues or tickets separated by commas.
Type of Change
Changes Made
getPlaybackInfoimplementations to pass the selected audio/subtitle indices in query parameters, forcing the server to register transcoding sessions with the correct user choices.?) in server query parameters to satisfy the compiler and project-specific lint rules.Uriquery parsing inMediaStreamResolver.applyStreamIndicesthat updates/syncs bothsubtitleStreamIndex(camelCase) andSubtitleStreamIndex(PascalCase).PlaybackManagerto match transcoding flows.Media3VideoView.ktand deferred execution until track selection data is loaded viaonTracksChanged(resolving timing/race conditions on ExoPlayer initialization). Cleared pending fields insetSourceto prevent leaking selections to subsequent streams.ItemDetailViewModelto avoid reset when buttons are temporarily unmounted during detail screen view model reloads.IsDefault == trueif preferred language user settings are empty.Platform
Testing
Describe how this change was tested.
Test Steps
Screenshots (if applicable)
Demonstrating a file where a custom sub track was selected from Media Info page and the change reflected in both the UI and the subtitle:
Checklist