Ticket #3525: 1854550.diff

File 1854550.diff, 915 bytes (added by cyxx, 16 years ago)
  • imuse_digi/dimuse_track.cpp

     
    7171}
    7272
    7373void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, int volGroupId, Audio::AudioStream *input, int hookId, int volume, int priority) {
     74        Common::StackLock lock(_mutex, "IMuseDigital::startSound()");
    7475        debug(5, "IMuseDigital::startSound(%d)", soundId);
    7576
    7677        int l = allocSlot(priority);
     
    8182
    8283        Track *track = _track[l];
    8384        while (1) {
    84                 _mutex.lock();
    8585                if (!track->used) {
    8686                        break;
    8787                }
     
    9494#ifndef __PLAYSTATION2__
    9595                _vm->parseEvents();
    9696#endif
     97                _mutex.lock();
    9798        }
    9899
    99100        track->pan = 64;
     
    191192        }
    192193
    193194        track->used = true;
    194         _mutex.unlock();
    195195}
    196196
    197197void IMuseDigital::setPriority(int soundId, int priority) {