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
This commit is contained in:
Lennart Poettering 2010-01-08 20:07:34 +01:00
parent c41ee00893
commit 8d356659e6
3 changed files with 55 additions and 57 deletions

View file

@ -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;