This file is part of polypaudio.
polypaudio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
+ it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with polypaudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
struct pa_memblockq {
struct memblock_list *blocks, *blocks_tail;
unsigned n_blocks;
- size_t current_length, maxlength, tlength, base, prebuf, minreq;
+ size_t current_length, maxlength, tlength, base, prebuf, orig_prebuf, minreq;
struct pa_mcalign *mcalign;
struct pa_memblock_stat *memblock_stat;
};
bq->prebuf = (bq->prebuf/base)*base;
if (bq->prebuf > bq->maxlength)
bq->prebuf = bq->maxlength;
+
+ bq->orig_prebuf = bq->prebuf;
bq->minreq = (minreq/base)*base;
if (bq->minreq == 0)
void pa_memblockq_drop(struct pa_memblockq *bq, const struct pa_memchunk *chunk, size_t length) {
assert(bq && chunk && length);
- if (!bq->blocks || memcmp(&bq->blocks->chunk, chunk, sizeof(struct pa_memchunk)))
+ if (!bq->blocks || memcmp(&bq->blocks->chunk, chunk, sizeof(struct pa_memchunk)))
return;
-
+
assert(length <= bq->blocks->chunk.length);
pa_memblockq_skip(bq, length);
}
if (bq->current_length <= length)
return;
- pa_log(__FILE__": Warning! pa_memblockq_shorten()\n");
+ /*pa_log(__FILE__": Warning! pa_memblockq_shorten()\n");*/
l = bq->current_length - length;
l /= bq->base;
bq->prebuf = 0;
}
+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);