lavu/fifo: add av_fifo_alloc_array function

Allows to alloc fifo buffer by passing
number of elements and size of element.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
This commit is contained in:
Lukasz Marek
2014-05-20 00:00:44 +02:00
parent d43c303038
commit 7336e39f3c
4 changed files with 33 additions and 7 deletions
+8
View File
@@ -41,6 +41,14 @@ typedef struct AVFifoBuffer {
*/
AVFifoBuffer *av_fifo_alloc(unsigned int size);
/**
* Initialize an AVFifoBuffer.
* @param nmemb number of elements
* @param size size of the single element
* @return AVFifoBuffer or NULL in case of memory allocation failure
*/
AVFifoBuffer *av_fifo_alloc_array(size_t nmemb, size_t size);
/**
* Free an AVFifoBuffer.
* @param f AVFifoBuffer to free