diff options
Diffstat (limited to 'src/pulsecore')
-rw-r--r-- | src/pulsecore/memblockq.c | 6 | ||||
-rw-r--r-- | src/pulsecore/memblockq.h | 2 | ||||
-rw-r--r-- | src/pulsecore/protocol-native.c | 6 | ||||
-rw-r--r-- | src/pulsecore/sink-input.c | 2 |
4 files changed, 11 insertions, 5 deletions
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) { diff --git a/src/pulsecore/memblockq.h b/src/pulsecore/memblockq.h index b756549a..402c6cdb 100644 --- a/src/pulsecore/memblockq.h +++ b/src/pulsecore/memblockq.h @@ -118,7 +118,7 @@ size_t pa_memblockq_pop_missing(pa_memblockq *bq); int pa_memblockq_splice(pa_memblockq *bq, pa_memblockq *source); /* Set the queue to silence, set write index to read index */ -void pa_memblockq_flush_write(pa_memblockq *bq); +void pa_memblockq_flush_write(pa_memblockq *bq, pa_bool_t account); /* Set the queue to silence, set write read index to write index*/ void pa_memblockq_flush_read(pa_memblockq *bq); diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index 89f33d08..ff246120 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -1326,6 +1326,10 @@ static void handle_seek(playback_stream *s, int64_t indexw) { playback_stream_request_bytes(s); } +static void flush_write_no_account(pa_memblockq *q) { + pa_memblockq_flush_write(q, FALSE); +} + /* Called from thread context */ static int sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offset, pa_memchunk *chunk) { pa_sink_input *i = PA_SINK_INPUT(o); @@ -1387,7 +1391,7 @@ static int sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int switch (code) { case SINK_INPUT_MESSAGE_FLUSH: - func = pa_memblockq_flush_write; + func = flush_write_no_account; break; case SINK_INPUT_MESSAGE_PREBUF_FORCE: diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index e73999d9..395110b7 100644 --- a/src/pulsecore/sink-input.c +++ b/src/pulsecore/sink-input.c @@ -842,7 +842,7 @@ void pa_sink_input_process_rewind(pa_sink_input *i, size_t nbytes /* in sink sam /* We were asked to drop all buffered data, and rerequest new * data from implementor the next time push() is called */ - pa_memblockq_flush_write(i->thread_info.render_memblockq); + pa_memblockq_flush_write(i->thread_info.render_memblockq, TRUE); } else if (i->thread_info.rewrite_nbytes > 0) { size_t max_rewrite, amount; |