mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
opensles: only drain half ringbuffer on start
At start drain half ringbuffer into the OpenSL so the writting/reading pointers will start at half ringbuffer distance.
This commit is contained in:
parent
3698d98921
commit
08ef2e3eed
1 changed files with 3 additions and 3 deletions
|
@ -348,7 +348,7 @@ _opensles_player_acquire (GstRingBuffer * rb, GstRingBufferSpec * spec)
|
|||
|
||||
/* Configure audio source */
|
||||
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {
|
||||
SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, spec->segtotal
|
||||
SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, (spec->segtotal >> 1)
|
||||
};
|
||||
SLDataSource audioSrc = { &loc_bufq, &format };
|
||||
|
||||
|
@ -439,7 +439,7 @@ _opensles_player_acquire (GstRingBuffer * rb, GstRingBufferSpec * spec)
|
|||
_opensles_player_change_mute (rb);
|
||||
|
||||
/* Define our queue data buffer */
|
||||
thiz->data_segtotal = spec->segtotal + 1;
|
||||
thiz->data_segtotal = loc_bufq.numBuffers + 1;
|
||||
thiz->data = g_malloc (spec->segsize * thiz->data_segtotal);
|
||||
thiz->cursor = 0;
|
||||
|
||||
|
@ -502,7 +502,7 @@ _opensles_player_start (GstRingBuffer * rb)
|
|||
}
|
||||
|
||||
/* Fill the queue by enqueing buffers */
|
||||
for (i = 0; i < rb->spec.segtotal; i++) {
|
||||
for (i = 0; i < (rb->spec.segtotal >> 1); i++) {
|
||||
_opensles_player_cb (NULL, rb);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue