summaryrefslogtreecommitdiff
path: root/sys/opensles
diff options
context:
space:
mode:
authorJosep Torra <n770galaxy@gmail.com>2012-09-27 17:46:27 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-10-18 14:03:09 +0200
commite265cec514dfce6bf8ef5927a7b3aae45920e9cc (patch)
treede158c0f5f3300bd80767dc39fd2cac1b101bdd1 /sys/opensles
parentcc6fc1567404fb99a9f0bc275a24896d829e8e9e (diff)
downloadgstreamer-plugins-bad-e265cec514dfce6bf8ef5927a7b3aae45920e9cc.tar.gz
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.
Diffstat (limited to 'sys/opensles')
-rw-r--r--sys/opensles/openslesringbuffer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/opensles/openslesringbuffer.c b/sys/opensles/openslesringbuffer.c
index c2af73aa3..295658a6b 100644
--- a/sys/opensles/openslesringbuffer.c
+++ b/sys/opensles/openslesringbuffer.c
@@ -348,7 +348,8 @@ _opensles_player_acquire (GstRingBuffer * rb, GstRingBufferSpec * spec)
/* Configure audio source */
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {
- SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, (spec->segtotal >> 1)
+ SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE,
+ MIN (32, (spec->segtotal >> 1))
};
SLDataSource audioSrc = { &loc_bufq, &format };
@@ -439,7 +440,7 @@ _opensles_player_acquire (GstRingBuffer * rb, GstRingBufferSpec * spec)
_opensles_player_change_mute (rb);
/* 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->cursor = 0;
@@ -502,7 +503,7 @@ _opensles_player_start (GstRingBuffer * rb)
}
/* 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);
}