memblockq: move minreq handling in to memblockq

Having it handled in the callers proved to be a poor fit as it
became difficult to handle a shrinking minreq sanely. It could end
up in a state where the request was never sent downstream to the
client.
This commit is contained in:
Pierre Ossman 2016-05-19 15:26:08 +02:00 committed by Arun Raghavan
parent edff1b2204
commit eeec52caa0
2 changed files with 6 additions and 7 deletions

View file

@ -840,6 +840,10 @@ size_t pa_memblockq_pop_missing(pa_memblockq *bq) {
if (bq->missing <= 0)
return 0;
if (((size_t) bq->missing < bq->minreq) &&
!pa_memblockq_prebuf_active(bq))
return 0;
l = (size_t) bq->missing;
bq->requested += bq->missing;