[FFmpeg-soc] [PATCH] Add af_sox initial draft

S.N. Hemanth Meenakshisundaram smeenaks at ucsd.edu
Mon Aug 16 10:29:14 CEST 2010


On 08/15/2010 11:08 AM, Stefano Sabatini wrote:
> On date Sunday 2010-08-15 00:05:07 -0700, S.N. Hemanth Meenakshisundaram encoded:
>   
>
> Looks fine.
>
> If I understood it correctly so we have this design:
> [lavfi input fifo] [sox input handler] [sox effects] [sox output handler] [lavfi output fifo]
>   

Yes. The fifos are internal to af_sox and use the fifo.h/fifo.c in
libavutil.


>
>> +    if (*osamp < input_nb_samples)
>> +        input_nb_samples = *osamp;
>>     
> I have a doubt about this, is osamp a numer of samples or the used size
> of the samples buffer?
> In the latter case this check looks wrong.
>   

It is actually both. In sox, when they talk of 'number of samples', they
mean 'number of samples * number of channels'. I will call this
sox_nb_samples. Actual buffer size = sox_nb_samples * sizeof(int) since
format is S32. When sox calls this function, *osamp has the maximum
sox_nb_samples it can accept. When returning from this function, we need
to reset it to the 'sox_nb_samples' that we actually copied into the sox
provided buffer.

The attached patch has some bug fixes and all fixes/nits from review
comments except the 3 below:

1. Need to replace strtok with strtok_r.

2. Format negotiation posted separately, this has a fallback to fail in
case no proper format is specified.

3. Will add texi file once changes work without crashing.

---
 libavfilter/Makefile     |    1 +
 libavfilter/af_sox.c     |  355 ++++++++++++++++++++++++++++++++++++++++++++++
 libavfilter/allfilters.c |    1 +
 3 files changed, 357 insertions(+), 0 deletions(-)


 create mode 100644 libavfilter/af_sox.c


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-af_sox-sox-effects-library-wrapper.patch
Type: text/x-patch
Size: 14190 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20100816/02387418/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Configure-script-changes-for-af_sox.patch
Type: text/x-patch
Size: 1804 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20100816/02387418/attachment-0001.bin>


More information about the FFmpeg-soc mailing list