TEENAGENT: Fix for bug #3428161 "PSP: No music in TeenAgent".

This could occur on other platforms too and was a race hazard between
mixer thread startup and music being valid i.e. If the music doesn't
already exist, when the mixer callback is done, this deletes the channel
as idle. Reordered the calls to fix this.

Also, removed unecessary music->start() as this is done by setMusic(n)
on successful load anyway.
This commit is contained in:
D G Turner 2012-08-02 12:41:40 +01:00
parent 259f262592
commit 52a1a6e60b

View File

@ -535,9 +535,8 @@ Common::Error TeenAgentEngine::run() {
syncSoundSettings();
_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, music, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, false);
setMusic(1);
music->start();
_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, music, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, false);
int load_slot = Common::ConfigManager::instance().getInt("save_slot");
if (load_slot >= 0) {