fix: player disposed race condition

This commit is contained in:
edde746
2026-03-04 14:37:51 +01:00
parent 5f4e4bfdd3
commit 551bd83ffe
6 changed files with 69 additions and 110 deletions
@@ -765,6 +765,8 @@ class TrackSelectionService {
attempts++;
}
if (player.disposed) return;
// Get real tracks (excluding auto and no)
final realAudioTracks = player.state.tracks.audio.where((t) => t.id != 'auto' && t.id != 'no').toList();
final realSubtitleTracks = player.state.tracks.subtitle.where((t) => t.id != 'auto' && t.id != 'no').toList();