[MPlayer-dev-eng] Audio filters first design proposal

Anders Johansson ajh at atri.curtin.edu.au
Mon Jul 22 12:15:15 CEST 2002


Hi,

Here we go again. This time the filter actually works there is even
a sample filter included (improved version of delay).

My idea for buffering is as follows:

1. af_init is called no buffess are created.

2. Playing starts  playsize=audio_out->get_space();

3. Get size multiplier form af layer mul=af_getmul();

4. Calculate number of bytes requires to fill aodio out buffer
   playsize*= (int)((double)playsize * mul);  mul can be less than 1.

5. Get playsize amount of data from decode_audio()

6. Filter data through filters af_play(pafd); buffers are reallocated
   using helper macro RESIZE_LOCAL_BUFFER() inside the filters (see
   af_delay.c) if they are too small. This way runtime loaded filters
   are compensated for.

7. If filtered data chunk is too large for ao_play() buffer it using a
   dynamic buffer. I need help implementing this. 



The diff breaks mplayer.c (a little bit) and is _not_ meant for
inclusion in the main branch.

Edit af.c around line 259 to enable the delay filter.

As you will notice we need functionality to compensate for delay
ceated by the filters. I will implement this once the buffering is
solved. 


I have an idea: I would like to take out some or all of the audio
stream manageent from mplayer.c and create a new file called
mp_audio.c where buffering, driver magement, the mixer and hardware
probing (through the drivers) is implemented. I would like to do the
same for mencoder. Do you like ths idea?


Cheers,
//Anders


-------------- next part --------------
A non-text attachment was scrubbed...
Name: libaf.diff.gz
Type: application/octet-stream
Size: 7536 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20020722/2db263ad/attachment.obj>


More information about the MPlayer-dev-eng mailing list