From faba0ffadab237ef490c98c6b14bcfa34943e007 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 3 Jul 2021 15:36:51 -0700 Subject: [PATCH] Fix index seeking with tracks with no index 0 --- RedBookPlayer/Discs/CompactDisc.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RedBookPlayer/Discs/CompactDisc.cs b/RedBookPlayer/Discs/CompactDisc.cs index 87b670a..21e8fc8 100644 --- a/RedBookPlayer/Discs/CompactDisc.cs +++ b/RedBookPlayer/Discs/CompactDisc.cs @@ -79,8 +79,8 @@ namespace RedBookPlayer.Discs // Ensure that the value is valid, wrapping around if necessary if(value > track.Indexes.Keys.Max()) - _currentTrackIndex = 0; - else if(value < 0) + _currentTrackIndex = track.Indexes.Keys.Min(); + else if(value < track.Indexes.Keys.Min()) _currentTrackIndex = track.Indexes.Keys.Max(); else _currentTrackIndex = value;