diff options
author | Josep Torra <n770galaxy@gmail.com> | 2012-09-21 17:04:14 +0200 |
---|---|---|
committer | Josep Torra <n770galaxy@gmail.com> | 2012-09-21 17:04:14 +0200 |
commit | c7cc4d93f6092a9b01676342d493a9695a300b64 (patch) | |
tree | 454c24ac88f50c292ea672c23e8d0c972acb0507 | |
parent | e7bdb1e8687ceead0f805a9c9988691c3faf4d9d (diff) |
opensles: use 0.25s segments in the sink to lower latency
-rw-r--r-- | sys/opensles/openslesringbuffer.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/opensles/openslesringbuffer.c b/sys/opensles/openslesringbuffer.c index 49ecf3c25..6dfbdf93c 100644 --- a/sys/opensles/openslesringbuffer.c +++ b/sys/opensles/openslesringbuffer.c @@ -435,13 +435,9 @@ _opensles_player_acquire (GstRingBuffer * rb, GstRingBufferSpec * spec) _opensles_player_change_mute (rb); /* Define our ringbuffer in terms of number of buffers and buffer size. */ - spec->segsize = (spec->rate * spec->bytes_per_sample); - spec->segtotal = 4; - /* In the Nexus7 device where I'm testing seems that I need buffers of - * min 1 second of audio. - * Then here we created 4 segments of a second and a queue of 2 buffers - * in order to properly clear the older segment */ - thiz->last_clearseg = -3; + spec->segsize = (spec->rate * spec->bytes_per_sample) >> 2; + spec->segtotal = 16; + thiz->last_clearseg = 1 - spec->segtotal; return TRUE; |