/* Configure audio source */
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {
- SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, spec->segtotal
+ SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, (spec->segtotal >> 1)
};
SLDataSource audioSrc = { &loc_bufq, &format };
_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;
}
/* 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);
}