[FFmpeg-devel] [PATCH] lavu/fifo: add alloc functions

Lukasz Marek lukasz.m.luki2 at gmail.com
Sat May 10 02:10:10 CEST 2014


On 10.05.2014 01:06, Michael Niedermayer wrote:
> On Tue, May 06, 2014 at 11:53:05PM +0200, Lukasz Marek wrote:
>> TODO: minor bump and doc/APIchanges update
>>
>> Allows to alloc fifo with predefined buffer or by
>> passing number of elements and size of element.
>>
>> Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
>> ---
>>   libavutil/fifo.c | 31 ++++++++++++++++++++++++++-----
>>   libavutil/fifo.h | 19 ++++++++++++++++++-
>>   2 files changed, 44 insertions(+), 6 deletions(-)
>>
>> diff --git a/libavutil/fifo.c b/libavutil/fifo.c
>> index fabf35e..f1571e8 100644
>> --- a/libavutil/fifo.c
>> +++ b/libavutil/fifo.c
>
>> @@ -24,16 +24,37 @@
>>   #include "common.h"
>>   #include "fifo.h"
>>
>> -AVFifoBuffer *av_fifo_alloc(unsigned int size)
>
>> +AVFifoBuffer *av_fifo_alloc_buffer(void *buffer, size_t size)
>
> i understand why a _array function would be useful but can you
> explain the usecase of this function ?

In .c it is convenient to not duplicate code.
I rushed to much to place it in header too, I realized that too after 
sending a patch.



More information about the ffmpeg-devel mailing list