fix: Subtitle off and subtitle stream selection logic#893
Merged
PartyDonut merged 1 commit intoDonutWare:developfrom Apr 4, 2026
Merged
fix: Subtitle off and subtitle stream selection logic#893PartyDonut merged 1 commit intoDonutWare:developfrom
PartyDonut merged 1 commit intoDonutWare:developfrom
Conversation
cb289fb to
66fd49d
Compare
PartyDonut
approved these changes
Apr 4, 2026
Collaborator
PartyDonut
left a comment
There was a problem hiding this comment.
Looks good to me, thanks
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 Description
This pull request improves the handling of default subtitle and audio stream selection in the playback models and ensures more robust and consistent behavior when no valid stream is found. The main focus is on returning a default "no stream" object instead of null, and updating the player wrappers to correctly handle these cases.
Improvements to stream selection logic:
PlaybackModelExtensioninplayback_model.dartso thatdefaultSubStreamanddefaultAudioStreamreturn a default "no stream" object (e.g.,SubStreamModel.no(),AudioStreamModel.no()) when no valid stream is found, instead of returning null. This makes downstream code safer and more predictable.Player wrapper updates for subtitle track selection:
LibMDK(lib_mdk.dart), modifiedsetSubtitleTrackto check for both null and the default "no" subtitle stream, disabling external subtitles and returning-1when appropriate.LibMDK'ssetSubtitleTrackby removing a redundant return statement.LibMPV(lib_mpv.dart), consolidated the check for invalid subtitle streams (null or "no" stream), ensuring that the player disables subtitles and returns-1in these cases, and moved the codec assignment after the check for clarity and correctness.LibMPVto remove unnecessary braces after handling subtitle tracks.Issue Being Fixed
Resolves #877
Screenshots / Recordings
Checklist