From 699233fb47d133f6ea1e36e8354a386c23608d5a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 8 Jan 2010 20:07:34 +0100 Subject: native: fix request counter miscalculations Do not subtract bytes the client sends us beyond what we requested from our missing bytes counter. This was mostly a thinko that caused servers asking for too little data when the client initially sent more data than requested, because that data sent too much was accounted for twice. This commit fixes this miscalculation. http://bugzilla.redhat.com/show_bug.cgi?id=534130 --- src/pulsecore/protocol-native.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/pulsecore/protocol-native.c') diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index d49a78e5..89f33d08 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -1114,6 +1114,8 @@ static playback_stream* playback_stream_new( *missing = (uint32_t) pa_memblockq_pop_missing(s->memblockq); + /* pa_log("missing original: %li", (long int) *missing); */ + *ss = s->sink_input->sample_spec; *map = s->sink_input->channel_map; @@ -1138,11 +1140,12 @@ static void playback_stream_request_bytes(playback_stream *s) { m = pa_memblockq_pop_missing(s->memblockq); - /* pa_log("request_bytes(%lu) (tlength=%lu minreq=%lu length=%lu)", */ + /* pa_log("request_bytes(%lu) (tlength=%lu minreq=%lu length=%lu really missing=%lli)", */ /* (unsigned long) m, */ /* pa_memblockq_get_tlength(s->memblockq), */ /* pa_memblockq_get_minreq(s->memblockq), */ - /* pa_memblockq_get_length(s->memblockq)); */ + /* pa_memblockq_get_length(s->memblockq), */ + /* (long long) pa_memblockq_get_tlength(s->memblockq) - (long long) pa_memblockq_get_length(s->memblockq)); */ if (m <= 0) return; -- cgit