diff --git a/src/apps/cdplayer/CDEngine.cpp b/src/apps/cdplayer/CDEngine.cpp index e5adebfb09..2af351d1d4 100644 --- a/src/apps/cdplayer/CDEngine.cpp +++ b/src/apps/cdplayer/CDEngine.cpp @@ -148,8 +148,16 @@ TrackState::UpdateState() } // If we're not playing, just monitor the current track in the playlist - cdTrack = sPlayList.GetCurrentTrack(); count = gCDDevice.CountTracks(); + if(count>0) + { + cdTrack = sPlayList.GetCurrentTrack(); + } + else + { + sPlayList.SetTrackCount(0); + cdTrack=-1; + } return CurrentState(cdTrack,count); } diff --git a/src/apps/cdplayer/CDPlayer.cpp b/src/apps/cdplayer/CDPlayer.cpp index 53033e5921..ecf2320aaa 100644 --- a/src/apps/cdplayer/CDPlayer.cpp +++ b/src/apps/cdplayer/CDPlayer.cpp @@ -498,7 +498,11 @@ CDPlayer::UpdateCDInfo(void) bool trackresult = engine->ContentWatcher()->GetContent(&CDName,&trackNames); if(currentTrack < 0) + { + fCDTitle->SetText(""); + fCurrentTrack->SetText(""); return; + } if(currentTrack == 0) currentTrack++; diff --git a/src/apps/cdplayer/PlayList.cpp b/src/apps/cdplayer/PlayList.cpp index d578d5eeaa..77519f96c1 100644 --- a/src/apps/cdplayer/PlayList.cpp +++ b/src/apps/cdplayer/PlayList.cpp @@ -48,7 +48,10 @@ PlayList::SetTrackCount(const int16 &count) STRACE(("PlayList::SetTrackCount(%d)\n",count)); if(count < 0) + { fTrackCount = 0; + fTrackIndex = 0; + } else if(count > 500) fTrackCount = 500; @@ -145,7 +148,7 @@ PlayList::GetCurrentTrack(void) fLocker.Lock(); int16 value = fTrackList[fTrackIndex]; - STRACE(("PlayList::GetCurrentTrack()=%d\n",value)); +// STRACE(("PlayList::GetCurrentTrack()=%d\n",value)); fLocker.Unlock(); return value;