mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-23 08:09:51 +00:00
Android OpenSL: Fix bug where we should have enqueued two buffers on startup.
I don't actually think this matters much though. Seems to make absolutely no difference on any of my devices, but you never know.
This commit is contained in:
parent
e723594133
commit
54570fdfb4
@ -124,13 +124,16 @@ bool OpenSLContext::Init() {
|
||||
result = (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_PLAYING);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
|
||||
// Render and enqueue a first buffer. (or should we just play the buffer empty?)
|
||||
buffer[0] = new short[framesPerBuffer * 2];
|
||||
buffer[1] = new short[framesPerBuffer * 2];
|
||||
// Enqueue two empty buffers.
|
||||
buffer[0] = new short[framesPerBuffer * 2]{};
|
||||
buffer[1] = new short[framesPerBuffer * 2]{};
|
||||
|
||||
curBuffer = 0;
|
||||
audioCallback(buffer[curBuffer], framesPerBuffer);
|
||||
|
||||
result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, buffer[curBuffer], sizeof(buffer[curBuffer]));
|
||||
if (SL_RESULT_SUCCESS != result) {
|
||||
return false;
|
||||
}
|
||||
curBuffer ^= 1;
|
||||
result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, buffer[curBuffer], sizeof(buffer[curBuffer]));
|
||||
if (SL_RESULT_SUCCESS != result) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user