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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux