summaryrefslogtreecommitdiffstats
path: root/src/pulse/stream.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/pulse/stream.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/pulse/stream.c')
-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 40812566..0f9e50ab 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);
@@ -1362,6 +1364,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 */