[pulseaudio-discuss] [PATCH v2] pacat: Write to stream in frame-sized chunks

Pierre Ossman ossman at cendio.se
Tue Dec 27 10:25:56 UTC 2016


On 26/12/16 06:31, Ahmed S. Darwish wrote:
>
> But bq->requested has different semantics upon write index change
> before and after the same commit:
>

More cleanup and comments of that code is probably needed to make it 
manageable by mere mortals. :)

> After the cleanup commit:
>
> static void write_index_changed(pa_memblockq *bq, int64_t old_write_index,
>                                 bool account) {
>   int64_t delta;
>
>   delta = bq->write_index - old_write_index;
>
>   if (account) {
>     if (delta > (int64_t)bq->requested)
>       bq->requested = 0;        <== Here is the trigger; bq 'requested'
>                                 <== only adjusted in the positive case
>     else if (delta > 0)
>       bq->requested -= delta;
>   }
>   ...
> }

Allow bq->requested to be negative is a bad idea IMO as it conceptually 
makes little to no sense.

Is it sufficient to remove the second if? What would that mean though? 
An alternative way of increasing the requested size? Why is this 
happening? What's the call chain?

Regards
-- 
Pierre Ossman           Software Development
Cendio AB               https://cendio.com
Teknikringen 8          https://twitter.com/ThinLinc
583 30 Linköping        https://facebook.com/ThinLinc
Phone: +46-13-214600    https://plus.google.com/+CendioThinLinc

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


More information about the pulseaudio-discuss mailing list