summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/protocol-native.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-08 20:07:34 +0100
committerColin Guthrie <cguthrie@mandriva.org>2010-02-09 22:29:20 +0000
commit699233fb47d133f6ea1e36e8354a386c23608d5a (patch)
treed749a60c0d19764672dc71a302088622c3b09e4d /src/pulsecore/protocol-native.c
parent66dbca1e06af0607a2d0fc6b8d14ef1ebb034f0a (diff)
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
Diffstat (limited to 'src/pulsecore/protocol-native.c')
-rw-r--r--src/pulsecore/protocol-native.c7
1 files changed, 5 insertions, 2 deletions
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;