From b349dae6e146233175c38f46d4bd964b06a2ccd2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 30 Mar 2009 18:27:07 +0200 Subject: add pa_memblockq_apply_attr()/pa_memblockq_get_attr() --- src/pulsecore/memblockq.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/pulsecore/memblockq.c') diff --git a/src/pulsecore/memblockq.c b/src/pulsecore/memblockq.c index e2be42b3..e6e7b736 100644 --- a/src/pulsecore/memblockq.c +++ b/src/pulsecore/memblockq.c @@ -851,6 +851,26 @@ void pa_memblockq_set_maxrewind(pa_memblockq *bq, size_t maxrewind) { bq->maxrewind = (maxrewind/bq->base)*bq->base; } +void pa_memblockq_apply_attr(pa_memblockq *bq, const pa_buffer_attr *a) { + pa_assert(bq); + pa_assert(a); + + pa_memblockq_set_maxlength(bq, a->maxlength); + pa_memblockq_set_tlength(bq, a->tlength); + pa_memblockq_set_prebuf(bq, a->prebuf); + pa_memblockq_set_minreq(bq, a->minreq); +} + +void pa_memblockq_get_attr(pa_memblockq *bq, pa_buffer_attr *a) { + pa_assert(bq); + pa_assert(a); + + a->maxlength = (uint32_t) pa_memblockq_get_maxlength(bq); + a->tlength = (uint32_t) pa_memblockq_get_tlength(bq); + a->prebuf = (uint32_t) pa_memblockq_get_prebuf(bq); + a->minreq = (uint32_t) pa_memblockq_get_minreq(bq); +} + int pa_memblockq_splice(pa_memblockq *bq, pa_memblockq *source) { pa_assert(bq); -- cgit