mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Android buildfix
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
|
||||
typedef int (*AndroidAudioCallback)(short *buffer, int numSamples, int sampleRateHz, void *userdata);
|
||||
typedef void (*AndroidAudioCallback)(short *buffer, int numSamples, int sampleRateHz, void *userdata);
|
||||
|
||||
class AudioContext {
|
||||
public:
|
||||
|
||||
@@ -49,13 +49,9 @@ void OpenSLContext::BqPlayerCallback(SLAndroidSimpleBufferQueueItf bq) {
|
||||
return;
|
||||
}
|
||||
|
||||
int renderedFrames = audioCallback(buffer[curBuffer], framesPerBuffer, SampleRate(), nullptr);
|
||||
audioCallback(buffer[curBuffer], framesPerBuffer, SampleRate(), nullptr);
|
||||
|
||||
int sizeInBytes = framesPerBuffer * 2 * sizeof(short);
|
||||
int byteCount = (framesPerBuffer - renderedFrames) * 4;
|
||||
if (byteCount > 0) {
|
||||
memset(buffer[curBuffer] + renderedFrames * 2, 0, byteCount);
|
||||
}
|
||||
const int sizeInBytes = framesPerBuffer * 2 * sizeof(short);
|
||||
SLresult result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, buffer[curBuffer], sizeInBytes);
|
||||
|
||||
// TODO: get rid of this snprintf too
|
||||
@@ -64,7 +60,7 @@ void OpenSLContext::BqPlayerCallback(SLAndroidSimpleBufferQueueItf bq) {
|
||||
// the most likely other result is SL_RESULT_BUFFER_INSUFFICIENT,
|
||||
// which for this code example would indicate a programming error
|
||||
if (result != SL_RESULT_SUCCESS) {
|
||||
ERROR_LOG(Log::Audio, "OpenSL: Failed to enqueue! %i %i", renderedFrames, sizeInBytes);
|
||||
ERROR_LOG(Log::Audio, "OpenSL: Failed to enqueue! %i", sizeInBytes);
|
||||
}
|
||||
|
||||
curBuffer += 1; // Switch buffer
|
||||
|
||||
Reference in New Issue
Block a user