summaryrefslogtreecommitdiffstats
path: root/src/pulse
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/pulse
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/pulse')
-rw-r--r--src/pulse/stream.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index d01985bd..793277af 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -741,6 +741,8 @@ void pa_command_request(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tag
s->requested_bytes += bytes;
+ /* pa_log("got request for %lli, now at %lli", (long long) bytes, (long long) s->requested_bytes); */
+
if (s->requested_bytes > 0 && s->write_callback)
s->write_callback(s, (size_t) s->requested_bytes, s->write_userdata);
@@ -1354,6 +1356,8 @@ int pa_stream_write(
* that's OK, the server side applies the same error */
s->requested_bytes -= (seek == PA_SEEK_RELATIVE ? offset : 0) + (int64_t) length;
+ /* pa_log("wrote %lli, now at %lli", (long long) length, (long long) s->requested_bytes); */
+
if (s->direction == PA_STREAM_PLAYBACK) {
/* Update latency request correction */