Sas: Minor clenaup.
This commit is contained in:
parent
b52c432f06
commit
c99de6409d
2 changed files with 1 additions and 5 deletions
|
@ -109,10 +109,9 @@ int __SasThread() {
|
||||||
if (sasThreadState == SasThreadState::QUEUED) {
|
if (sasThreadState == SasThreadState::QUEUED) {
|
||||||
sas->Mix(sasThreadParams.outAddr, sasThreadParams.inAddr, sasThreadParams.leftVol, sasThreadParams.rightVol);
|
sas->Mix(sasThreadParams.outAddr, sasThreadParams.inAddr, sasThreadParams.leftVol, sasThreadParams.rightVol);
|
||||||
|
|
||||||
sasDoneMutex.lock();
|
std::lock_guard<std::mutex> doneGuard(sasDoneMutex);
|
||||||
sasThreadState = SasThreadState::READY;
|
sasThreadState = SasThreadState::READY;
|
||||||
sasDone.notify_one();
|
sasDone.notify_one();
|
||||||
sasDoneMutex.unlock();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -565,13 +565,10 @@ void SasInstance::MixVoice(SasVoice &voice) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SasInstance::Mix(u32 outAddr, u32 inAddr, int leftVol, int rightVol) {
|
void SasInstance::Mix(u32 outAddr, u32 inAddr, int leftVol, int rightVol) {
|
||||||
int voicesPlayingCount = 0;
|
|
||||||
|
|
||||||
for (int v = 0; v < PSP_SAS_VOICES_MAX; v++) {
|
for (int v = 0; v < PSP_SAS_VOICES_MAX; v++) {
|
||||||
SasVoice &voice = voices[v];
|
SasVoice &voice = voices[v];
|
||||||
if (!voice.playing || voice.paused)
|
if (!voice.playing || voice.paused)
|
||||||
continue;
|
continue;
|
||||||
voicesPlayingCount++;
|
|
||||||
MixVoice(voice);
|
MixVoice(voice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue