FINALLY!! THE SOLUTION:
1. Close iTunes.
2. Move the selected files at username/music/itunes to your desktop:
3. Run iTunes. iTunes will start as if it was the first time. All your preferences, musics, books, apps will not appear at this time (do not worry). If you find any problem just put all files that you move to your desktop again on username/music/itunes
4. Click on 'Files' and select 'Library' and 'Import Library'. Choose: iTunes Library.xml at your desktop. (you can say "But this library was a mess!" Do not worry, iTunes will fix it).
5. iTunes will import data from that file. For me it spends 5-10 minutes depend on the size of your library (my library has 50gb with 10.000 musics).
6. After that you will see the annoying message on iTunes display: "Determining Gapless Playback Information" and much more musics than before (do not worry, it will be the last time that you will see it).
7. iTunes will do that and it is done. No more bugs.
8. Now you say: "Where is my apps, books, movies etc.?" Do not worry. Just move the folder at 'Itunes Media' (see image above) to iTunes, I mean, move folder "Books" to iTunes on 'Books'; move 'Home Video' folder to iTunes Movie; move 'Mobile Applications' to iTunes applications.
9. Close iTunes. Run it. Smile!
a. consider all your library is indexed, it means, all your music is organized at username/music/itunes/itunes media/music
b. consider you have to select again visualization mode for every music list.
Tested and works on iTunes 11.3.1 and Lion
I am not sure about playcount and ratings because I do not use/care about it. So I have not noticed about this features.
However I can guarantee your playlist will be intact (as my lists were). And since I posted this hack I have not had any problems with iTunes and this annoying bug.
But keep in mind you can revert all process. Just bring back all files that you removed from username/music/itunes (even after iTunes rebuild your library - step 4).
I did as Hiroshi.rio described and it solved the gapless playback problem.
My library is huge so it took a couple hours to chug through and re-load the library.
Playlists were mostly transferred over without a problem, a couple smart lists had to be re-done.
Play counts transferred over fine.
All media had a new 'data added", so that should be known ahead of time.
Also some media attributes, specificially videos needed to be tweeked to replicate the original library, but that's mostly because I have some pretty specific sorting methods.
Another caveat is that all my idevices needed to be re-synced with new library, not just a regular sync.
You can go into your old library to check things out as your getting the new library up and running, press "shift" as you click open itunes and it will allow you to choose the library to open.
Same as Tombellanca, I followed the instructions from Hiroshi.Rio and it worked beautifully. Although I do not have my playlists or ratings, I do have ALL my songs, do NOT have that annoying "Determining Gapless Playback Information" message again and I have a fully functional iTunes AND a computer that does not freeze.
I hope all the people with the same complains can see this thread and resolve their iTunes issues as I did.
@Hiroshi.Rio, man, you rock!
Haven't gotten Hiroshi.Rio's tip to work under Mavericks (read my first post of today).
I would be careful as a lot of the other tips that worked at first soon had the problem again once you've added new songs to your library.
During my own investigations I've found that most, if not all, of the music I've bought on Amazon and imported into iTunes caused the 'Gapless Playback scanning' problem but I'm not sure that's the reason iTunes is wonking out. I took out all my Amazon songs and the number of songs getting rescanned decreased greatly. However, I later created a new iTunes Library after moving my music and other media to a new drive - and wouldn't you know it, the problem started again with a high song count.
So, I have to believe its NOT a media problem but a serious problem with iTunes, one that has gone on far too long. Apple must know by now of the countless customers having this problem but no solution seems to be coming from them even after years of complaints.
It might come down to some smart user creating a hack using Terminal or Actions to get things fixed, at least until Apple makes changes in their code again.
Message was edited by: RobinOC
Glad to hear it worked for you too.
You can delete those files that you moved to desktop because new ones will be created when you choose "Import Library". In fact, when you start iTunes all those files will be created again despite the fact that you import or not your library.
Only do not move them back. Otherwise it will restore your previous (and bugged) library to iTunes.
Unfortunately the new iTunes update (11.1.4 version) did not solve the bug.