summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorLukasz Marek <lukasz.m.luki2@gmail.com>2014-05-06 21:28:51 +0200
committerLukasz Marek <lukasz.m.luki2@gmail.com>2014-05-07 23:39:42 +0200
commit351f6118c7e3da6ea7a2ab0a8f7d25b2223f7c5a (patch)
tree24afeeeb5953cc0329e40f7ce9cc851da6933188 /libavutil
parent54ae58802e9829a8b62edcbea683fe89a8c6fcfa (diff)
lavu/fifo: add av_fifo_freep function
Function allows to free fifo and reset freed pointer. Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/fifo.c8
-rw-r--r--libavutil/fifo.h6
-rw-r--r--libavutil/version.h2
3 files changed, 15 insertions, 1 deletions
diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 235b53ce40..e35237c090 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -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;
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index fe7364f427..66fb48a2ed 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -48,6 +48,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
*/
diff --git a/libavutil/version.h b/libavutil/version.h
index 3cb5b66666..a430c6b948 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -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, \