From 66cfa72eb4fd4669dfd7e465c07c41bb7e6d3d85 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 18 Jan 2010 01:33:04 +0100 Subject: native: rework handling of seeks that depend on variables the client does not know anything about All seeks/flushes that depend on the playback buffer read pointer cannot be accounted for properly in the client since it does not know the actual read pointer. Due to that the clients do not account for it at all. We need do the same on the server side. And we did, but a little bit too extreme. While we properly have not applied the changes to the "request" counter we still do have to apply it to the "missing" counter. This patch fixes that. --- src/pulsecore/memblockq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/pulsecore/memblockq.c') diff --git a/src/pulsecore/memblockq.c b/src/pulsecore/memblockq.c index 4641801d..2b063fac 100644 --- a/src/pulsecore/memblockq.c +++ b/src/pulsecore/memblockq.c @@ -254,6 +254,8 @@ static void write_index_changed(pa_memblockq *bq, int64_t old_write_index, pa_bo if (account) bq->requested -= delta; + else + bq->missing -= delta; /* pa_log("pushed/seeked %lli: requested counter at %lli, account=%i", (long long) delta, (long long) bq->requested, account); */ } @@ -642,7 +644,7 @@ void pa_memblockq_seek(pa_memblockq *bq, int64_t offset, pa_seek_mode_t seek, pa write_index_changed(bq, old, account); } -void pa_memblockq_flush_write(pa_memblockq *bq) { +void pa_memblockq_flush_write(pa_memblockq *bq, pa_bool_t account) { int64_t old; pa_assert(bq); @@ -652,7 +654,7 @@ void pa_memblockq_flush_write(pa_memblockq *bq) { bq->write_index = bq->read_index; pa_memblockq_prebuf_force(bq); - write_index_changed(bq, old, TRUE); + write_index_changed(bq, old, account); } void pa_memblockq_flush_read(pa_memblockq *bq) { -- cgit