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
committerLennart Poettering <lennart@poettering.net>2010-01-08 20:07:34 +0100
commit8d356659e69556fa25d0579a66084f820683e2b8 (patch)
treea8f2c929dc4540740f34a1c2d527f68bb35e0c7f /src/pulsecore/protocol-native.c
parentc41ee00893b6b0d5cc48ee041b8e4835eac548f0 (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 6e357624..b7b3f59d 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1113,6 +1113,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;
@@ -1137,11 +1139,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;