mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Safer track switching
This commit is contained in:
@@ -62,9 +62,6 @@ namespace RedBookPlayer.Common.Discs
|
||||
// Set track flags from subchannel data, if possible
|
||||
SetTrackFlags(track);
|
||||
|
||||
TotalIndexes = track.Indexes.Keys.Max();
|
||||
CurrentTrackIndex = track.Indexes.Keys.Min();
|
||||
|
||||
// If the track is playable, just return
|
||||
if(TrackType == TrackType.Audio || _loadDataTracks)
|
||||
break;
|
||||
@@ -78,6 +75,9 @@ namespace RedBookPlayer.Common.Discs
|
||||
while(cachedValue != _currentTrackNumber);
|
||||
|
||||
this.RaiseAndSetIfChanged(ref _currentTrackNumber, cachedTrackNumber);
|
||||
|
||||
TotalIndexes = GetTrack(_currentTrackNumber).Indexes.Keys.Max();
|
||||
CurrentTrackIndex = GetTrack(_currentTrackNumber).Indexes.Keys.Min();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user