fixed audio playing - dirty way

This commit is contained in:
h4570
2021-02-06 18:45:03 +01:00
parent 35fc8aea73
commit 4146df48a9
2 changed files with 15 additions and 2 deletions
+1
View File
@@ -126,6 +126,7 @@ public:
private: private:
u8 songLoaded, volume, realVolume, songPlaying, songInLoop, songFinished; u8 songLoaded, volume, realVolume, songPlaying, songInLoop, songFinished;
u8 hack; // TODO
std::vector<AudioListenerRef *> songListeners; std::vector<AudioListenerRef *> songListeners;
FILE *wav; FILE *wav;
audsrv_fmt_t format; audsrv_fmt_t format;
+14 -2
View File
@@ -178,8 +178,20 @@ void Audio::startThread(FileService *t_fileService)
/** Main thread loop */ /** Main thread loop */
void Audio::threadLoop() void Audio::threadLoop()
{ {
if (songPlaying) // ---
songPlaying = 1; // GCC11: wtf? we need to put some code there, because song is not playing.. // TODO - bug here, GCC11 is doing some optimizations and this method probably think that
// "songPlaying" is false + on real PS2 I see that program tries to turn on this
// method as rarely as possible (slow, flickering sound). On GCC 3.2.3 this one was fine lol!.
if (songPlaying) // HACK1 - im not proud of that
songPlaying = 1;
if (songLoaded)
songLoaded = 1;
if (hack == 1) // HACK2 - lets give some work to gcc lol
hack = 2;
else
hack = 1;
// ---
if (!songPlaying || !songLoaded) if (!songPlaying || !songLoaded)
return; return;
if (songFinished) if (songFinished)