fix(player): keep an explicit track choice through the pending automatic pass
When a source advertises subtitles the native track list has not produced yet, applyTrackSelectionWhenReady keeps an automatic selection armed for up to thirty seconds. That late pass re-runs TrackSelectionService against the stored preferences, so a track the user picked in the meantime was silently reset. The Maestro codec suites caught it: the English E-AC3 and Japanese DTS-HD flows select an audio track, and fifteen seconds later the deadline puts the preferred language back. Adds explicit user-selection entry points that retire the pending automatic selection first, and routes the sheet callbacks and the remote's cycle shortcuts through them. Subtitles get the same treatment, because the same pass re-selects them. Bumping the generation is sufficient: TrackSelectionService re-checks it in the statement immediately before each select call, and a mutation already in flight was dispatched before the user's and so lands first.
This commit is contained in:
@@ -1763,11 +1763,11 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _onAudioTrackChanged(AudioTrack track) async => _trackManager?.onAudioTrackChanged(track);
|
||||
Future<void> _onAudioTrackChanged(AudioTrack track) async => _trackManager?.onAudioTrackSelectedByUser(track);
|
||||
|
||||
Future<void> _onSubtitleTrackChanged(SubtitleTrack track, {int? sourceStreamId}) async {
|
||||
_rememberNativeSubtitleSelection(track, sourceStreamId: sourceStreamId);
|
||||
await _trackManager?.onSubtitleTrackChanged(track, sourceStreamId: sourceStreamId);
|
||||
await _trackManager?.onSubtitleTrackSelectedByUser(track, sourceStreamId: sourceStreamId);
|
||||
}
|
||||
|
||||
void _rememberNativeSubtitleSelection(SubtitleTrack track, {int? sourceStreamId}) {
|
||||
|
||||
Reference in New Issue
Block a user