+
+void pa_memblockq_prebuf_reenable(struct pa_memblockq *bq) {
+ assert(bq);
+ bq->prebuf = bq->orig_prebuf;
+}
+
+void pa_memblockq_seek(struct pa_memblockq *bq, size_t length) {
+ assert(bq);
+
+ if (!length)
+ return;
+
+ while (length >= bq->base) {
+ size_t l = length;
+ if (!bq->current_length)
+ return;
+
+ assert(bq->blocks_tail);
+
+ if (l > bq->blocks_tail->chunk.length)
+ l = bq->blocks_tail->chunk.length;
+
+ bq->blocks_tail->chunk.length -= l;
+ bq->current_length -= l;
+
+ if (bq->blocks_tail->chunk.length == 0)
+ remove_block(bq, bq->blocks);
+
+ length -= l;
+ }
+}
+
+void pa_memblockq_flush(struct pa_memblockq *bq) {
+ struct memblock_list *l;
+ assert(bq);
+
+ while ((l = bq->blocks)) {
+ bq->blocks = l->next;
+ pa_memblock_unref(l->chunk.memblock);
+ pa_xfree(l);
+ }
+
+ bq->blocks_tail = NULL;
+ bq->n_blocks = 0;
+ bq->current_length = 0;
+}
+
+uint32_t pa_memblockq_get_tlength(struct pa_memblockq *bq) {
+ assert(bq);
+ return bq->tlength;
+}