mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
openslesringbuffer: Only allocate at most half the number of internal buffers as external audioringbuffer ones
Otherwise we might end up reading too much from the audioringbuffer, which would result in reading silence.
This commit is contained in:
parent
9ed4054a94
commit
4ccd425772
1 changed files with 5 additions and 1 deletions
|
@ -358,9 +358,13 @@ _opensles_player_acquire (GstAudioRingBuffer * rb,
|
||||||
/* Configure audio source
|
/* Configure audio source
|
||||||
* 4 buffers is the "typical" size as optimized inside Android's
|
* 4 buffers is the "typical" size as optimized inside Android's
|
||||||
* OpenSL ES, see frameworks/wilhelm/src/itfstruct.h BUFFER_HEADER_TYPICAL
|
* OpenSL ES, see frameworks/wilhelm/src/itfstruct.h BUFFER_HEADER_TYPICAL
|
||||||
|
*
|
||||||
|
* Also only use half of our segment size to make sure that there's always
|
||||||
|
* some more queued up in our ringbuffer and we don't start to read silence.
|
||||||
*/
|
*/
|
||||||
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {
|
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {
|
||||||
SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, MIN (4, spec->segtotal)
|
SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, MIN (4, MAX (spec->segtotal >> 1,
|
||||||
|
1))
|
||||||
};
|
};
|
||||||
SLDataSource audioSrc = { &loc_bufq, &format };
|
SLDataSource audioSrc = { &loc_bufq, &format };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue