Ok, now actually creating 3 buffers initially.

This commit is contained in:
Armin Novak 2013-09-27 15:13:12 +02:00
parent b07caafdbf
commit c96cef5dd8
1 changed files with 12 additions and 0 deletions

View File

@ -322,6 +322,18 @@ void bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void *context)
e->data = calloc(p->buffersize, p->bits_per_sample / 8);
e->size = p->buffersize;
/* Initial fill up. */
if (!p->middle)
{
p->prep = e;
(*p->recorderBufferQueue)->Enqueue(p->recorderBufferQueue,
e->data, e->size);
e = calloc(1, sizeof(queue_element));
e->data = calloc(p->buffersize, p->bits_per_sample / 8);
e->size = p->buffersize;
}
p->next = p->middle;
p->middle = p->prep;
p->prep = e;