Why is my cd player not tracking on most cd's

Does anybody know why my cd player will only play certain cd's? With most cd's it fails to calculate the total number of tracks. It just keeps spinning the disc without actually playing it and I'm unable to stop the spinning by using the stop buttom. There are a select few cd's where it will calculate the total number of tracks and I can then play the entire disc without any problems. Thanks.
The length of a particular disc could be the problem. A check-up/diagnostic couldn't/wouldn't hurt.
Hair (IMO). A hair is stuck in your machine.. probably wrapped around the spindle.
I would just take the cover off and take a look.
....or it's begging you to get a computer based system. :)
Probably you need a new lens.
If your handy and want to save some $$

1st, try cleaning the lens, slide rails, gears, then lube (with the proper lube, sparingly)

2nd, try having the lens adjusted (good local tech did mine in 5 minutes)

3rd, if all the above fail, replace the lens and you're good to go, as long as the servo(s) are in good order.

I replaced the lens (Samsung) on my CEC and had my local tech dial it in, works better than the day I bought it.