Skip to content

Commit

Permalink
Android/openslES: set number of buffers of DATALOCATOR to internal NU…
Browse files Browse the repository at this point in the history
…M_BUFFER

If we increase NUM_BUFFER, Enqueue won't fail with SL_RESULT_BUFFER_INSUFFICIENT
  • Loading branch information
1bsyl committed Feb 5, 2019
1 parent bf823bf commit 614c8ae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/audio/openslES/SDL_openslES.c
Expand Up @@ -272,8 +272,7 @@ openslES_CreatePCMPlayer(_THIS)
this->spec.channels, (test_format & 0x1000) ? "BE" : "LE", this->spec.samples);

/* configure audio source */
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = { SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 2 };
/* SLDataLocator_AndroidSimpleBufferQueue loc_bufq = { SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, OPENSLES_BUFFERS }; */
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = { SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, NUM_BUFFERS };

format_pcm.formatType = SL_DATAFORMAT_PCM;
format_pcm.numChannels = this->spec.channels;
Expand Down

0 comments on commit 614c8ae

Please sign in to comment.