[vlc-devel] [PATCH] android: Change the buffer length for opensles

Dominique Martinet asmadeus at codewreck.org
Tue Feb 28 23:49:41 CET 2012


Hi,

Rémi Denis-Courmont wrote on Tue, Feb 28, 2012 :
> Since blocks are not empty, there cannot be more than
>    AOUT_MAX_ADVANCE_TIME * maximum sample rate
>  * minimum sample per block / CLOCK_FREQ
>  <= 576000 decoded blocks in the pipeline at a time.
> 
> That's a lot though.

I don't know how opensles handles its own queue, but it's too much
alright.

Since opensles needs a maximum size anyway, we just need to wait a
proper time when the current queue is full.
Can we assume things like all (most) buffers are of same length?
(I'd like to wait for the time needed to play the first buffer of the
list, but that would mean waiting longer than what is needed - therefor
I want to make sure that the e.g. 127 other samples in the queue put
together are at least as long as the first one to avoid starving)

I don't know if I'm clear, but I just don't know how long it would be
smart to wait.
Just properly checking that the queue isn't full before queueing
(instead of checking the queue function's return code) and waiting a bit
more than CLOCK_FREQ should help though
(minimum_sample_per_block*CLOCK_FREQ?)


Thanks,
-- 
Asmadeus | Dominique Martinet



More information about the vlc-devel mailing list