mirror of
https://github.com/libretro/ppsspp.git
synced 2024-12-04 23:16:41 +00:00
Merge pull request #2102 from oioitff/atrac-fix
The correct fix for choppy cg audios and bgm.
This commit is contained in:
commit
85d075db53
@ -132,7 +132,8 @@ u32 __AudioEnqueue(AudioChannel &chan, int chanNum, bool blocking)
|
||||
}
|
||||
|
||||
// If there's anything on the queue at all, it should be busy, but we try to be a bit lax.
|
||||
if (chan.sampleQueue.size() > chan.sampleCount * 2 * chanQueueMaxSizeFactor || chan.sampleAddress == 0) {
|
||||
//if (chan.sampleQueue.size() > chan.sampleCount * 2 * chanQueueMaxSizeFactor || chan.sampleAddress == 0) {
|
||||
if (chan.sampleQueue.size() > 0 || chan.sampleAddress == 0) {
|
||||
if (blocking) {
|
||||
// TODO: Regular multichannel audio seems to block for 64 samples less? Or enqueue the first 64 sync?
|
||||
int blockSamples = (int)chan.sampleQueue.size() / 2 / chanQueueMinSizeFactor;
|
||||
|
@ -1009,7 +1009,9 @@ int _AtracSetData(int atracID, u32 buffer, u32 bufferSize)
|
||||
Atrac *atrac = getAtrac(atracID);
|
||||
if (!atrac)
|
||||
return -1;
|
||||
return _AtracSetData(atrac, buffer, bufferSize);
|
||||
int ret = _AtracSetData(atrac, buffer, bufferSize);
|
||||
// not sure the real delay time
|
||||
return hleDelayResult(ret, "atrac set data", 100);
|
||||
}
|
||||
|
||||
u32 sceAtracSetHalfwayBuffer(int atracID, u32 halfBuffer, u32 readSize, u32 halfBufferSize)
|
||||
|
@ -110,10 +110,7 @@ u32 sceAudioOutputPannedBlocking(u32 chan, int leftvol, int rightvol, u32 sample
|
||||
chans[chan].rightVolume = rightvol;
|
||||
}
|
||||
chans[chan].sampleAddress = samplePtr;
|
||||
int ret = __AudioEnqueue(chans[chan], chan, true);
|
||||
if (chans[chan].waitingThreads.size() == 0)
|
||||
return hleDelayResult(ret, "output block", 1000);
|
||||
return ret;
|
||||
return __AudioEnqueue(chans[chan], chan, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -324,10 +321,7 @@ u32 sceAudioOutput2OutputBlocking(u32 vol, u32 dataPtr){
|
||||
chans[PSP_AUDIO_CHANNEL_OUTPUT2].leftVolume = vol;
|
||||
chans[PSP_AUDIO_CHANNEL_OUTPUT2].rightVolume = vol;
|
||||
chans[PSP_AUDIO_CHANNEL_OUTPUT2].sampleAddress = dataPtr;
|
||||
int ret = __AudioEnqueue(chans[PSP_AUDIO_CHANNEL_OUTPUT2], PSP_AUDIO_CHANNEL_OUTPUT2, true);
|
||||
if (chans[PSP_AUDIO_CHANNEL_OUTPUT2].waitingThreads.size() == 0)
|
||||
return hleDelayResult(ret, "output block", 1000);
|
||||
return ret;
|
||||
return __AudioEnqueue(chans[PSP_AUDIO_CHANNEL_OUTPUT2], PSP_AUDIO_CHANNEL_OUTPUT2, true);
|
||||
}
|
||||
|
||||
u32 sceAudioOutput2ChangeLength(u32 sampleCount){
|
||||
|
Loading…
Reference in New Issue
Block a user