Commit 351f6118 authored by Lukasz Marek's avatar Lukasz Marek

lavu/fifo: add av_fifo_freep function

Function allows to free fifo and reset freed pointer.
Signed-off-by: 's avatarLukasz Marek <lukasz.m.luki2@gmail.com>
parent 54ae5880
......@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first:
2014-05-xx - xxxxxxx - lavu 52.82.0 - fifo.h
Add av_fifo_freep() function.
2014-05-02 - ba52fb11 - lavu 52.81.0 - opt.h
Add av_opt_set_dict2() function.
......
......@@ -45,6 +45,14 @@ void av_fifo_free(AVFifoBuffer *f)
}
}
void av_fifo_freep(AVFifoBuffer **f)
{
if (f) {
av_fifo_free(*f);
*f = NULL;
}
}
void av_fifo_reset(AVFifoBuffer *f)
{
f->wptr = f->rptr = f->buffer;
......
......@@ -47,6 +47,12 @@ AVFifoBuffer *av_fifo_alloc(unsigned int size);
*/
void av_fifo_free(AVFifoBuffer *f);
/**
* Free an AVFifoBuffer and reset pointer to NULL.
* @param f AVFifoBuffer to free
*/
void av_fifo_freep(AVFifoBuffer **f);
/**
* Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
* @param f AVFifoBuffer to reset
......
......@@ -56,7 +56,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR 81
#define LIBAVUTIL_VERSION_MINOR 82
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment