- if( !cd || cd->status <= 0 ) {
- cdValid = false;
- return -1;
- }
- if( endtime > 0.0 && realtime >= endtime )
- if( SDL_CDStatus( cd ) == CD_STOPPED ){
- endtime = -1.0;
+ static time_t lastchk = 0;
+
+ if (cdPlaying && lastchk < time(NULL))
+ {
+ lastchk = time(NULL) + 2; //two seconds between chks
+ if( !cd || cd->status <= 0 ) {
+ cdValid = false;
+ return -1;
+ }
+ if (SDL_CDStatus( cd ) == CD_STOPPED)
+ {