Open Sonic49PH opened 2 years ago
Yeah so this happens because the BASS library runs in the same thread as the game.
Meaning that if your storage is slow it can cause these kinds of issues (it's especially noticeable with online streams).
This entire music player needs a rewrite anyways so I don't think I can fix these issues right now. Maybe moving the playback to a separate thread could work.
This is very noticeable once you add a frametime graph like MangoHUD. It's definitively visible on larger streams. Maybe it's caused by BASS_STREAM_PRESCAN flag, I'm not too sure, but the solution definitively is moving all music processing to a separate thread and only use the game thread for messaging.
Branch multithread was created for this purpose:
https://github.com/xan1242/XNFSMusicPlayer/tree/multithread
Idea is simple - add a simple push/pop queue messaging system and pass that info to the second thread through a message buffer.
I had tried the latest release of the XNFSMusicPlayer, but in-game without music, it just halts for a split-second.