[MPlayer-dev-eng] New audio filter layer finished

Arpi arpi at thot.banki.hu
Fri Oct 4 01:58:02 CEST 2002


Hi,

> > > that af_inputlen() is buggy anyway, it gives me a number, but if i request
> > > decoding of that number of bytes, i'll get few percent (hundreds bytes!)
> > > bigger output than requested, causing data loss sometimes :(
> > 
> > Sht I must have been brain damaged when I wrote that code.
> > I have tried to fix it have a look there are some comments about usage
> > added.
> > 
> 
> And now I have fixed the bugs I introduced. I am going to wear out the
> CVS before this works :(

hmm. still bad, now nearly always underestimate the buffer size :(
yes i know it isn't always possible toget the right size due to various
rounding.

it works well, but after most call it produces 4 bytes less then wanted, so
it's called again with minsize=4... 

so i have a better idea:
could you make/add a function to af.c core to calculate the number of input
bytes, with 2 extra constraint:
max_insize == maximum possible input block length (in. buffer size)
max_outsize == maximum possible output block length (out buffer space)

so, something like this:
int af_calc_insize_constrained(int wanted_outsize,int max_outsize,int max_insize);

it should return a value <= max_insize, to produce N output bytes where
N<=max_outsize, but if possible, N>=wanted_outsize

it's mostly implemented in my dec_audio.c patch now, but could be done
better in the af layer where you can access the in/outsize ratio and can do
the needed samplesize rounding too.

so, the dec_audio could call it with the minsize (wanted output size) and
the in/out buffer limits and it get back the optimal size for the given
buffering conditions.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list