mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
opensles: cap queue size
Just in case we want to tweak the sink behaviour with buffer-time and latency-time properties cap the queue size to something reasonable.
This commit is contained in:
parent
cc6fc15674
commit
e265cec514
1 changed files with 4 additions and 3 deletions
|
@ -348,7 +348,8 @@ _opensles_player_acquire (GstRingBuffer * rb, GstRingBufferSpec * spec)
|
||||||
|
|
||||||
/* Configure audio source */
|
/* Configure audio source */
|
||||||
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {
|
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {
|
||||||
SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, (spec->segtotal >> 1)
|
SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE,
|
||||||
|
MIN (32, (spec->segtotal >> 1))
|
||||||
};
|
};
|
||||||
SLDataSource audioSrc = { &loc_bufq, &format };
|
SLDataSource audioSrc = { &loc_bufq, &format };
|
||||||
|
|
||||||
|
@ -439,7 +440,7 @@ _opensles_player_acquire (GstRingBuffer * rb, GstRingBufferSpec * spec)
|
||||||
_opensles_player_change_mute (rb);
|
_opensles_player_change_mute (rb);
|
||||||
|
|
||||||
/* Define our queue data buffer */
|
/* Define our queue data buffer */
|
||||||
thiz->data_segtotal = loc_bufq.numBuffers + 1;
|
thiz->data_segtotal = loc_bufq.numBuffers;
|
||||||
thiz->data = g_malloc (spec->segsize * thiz->data_segtotal);
|
thiz->data = g_malloc (spec->segsize * thiz->data_segtotal);
|
||||||
thiz->cursor = 0;
|
thiz->cursor = 0;
|
||||||
|
|
||||||
|
@ -502,7 +503,7 @@ _opensles_player_start (GstRingBuffer * rb)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill the queue by enqueing buffers */
|
/* Fill the queue by enqueing buffers */
|
||||||
for (i = 0; i < (rb->spec.segtotal >> 1); i++) {
|
for (i = 0; i < thiz->data_segtotal; i++) {
|
||||||
_opensles_player_cb (NULL, rb);
|
_opensles_player_cb (NULL, rb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue