[FFmpeg-cvslog] lavu/fifo: add av_fifo_freep function
Lukasz Marek
git at videolan.org
Thu May 8 04:11:33 CEST 2014
ffmpeg | branch: master | Lukasz Marek <lukasz.m.luki2 at gmail.com> | Tue May 6 21:28:51 2014 +0200| [351f6118c7e3da6ea7a2ab0a8f7d25b2223f7c5a] | committer: Lukasz Marek
lavu/fifo: add av_fifo_freep function
Function allows to free fifo and reset freed pointer.
Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=351f6118c7e3da6ea7a2ab0a8f7d25b2223f7c5a
---
doc/APIchanges | 3 +++
libavutil/fifo.c | 8 ++++++++
libavutil/fifo.h | 6 ++++++
libavutil/version.h | 2 +-
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index 6c5bf45..da8b696 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -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.
diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 235b53c..e35237c 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 fe7364f..66fb48a 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 3cb5b66..a430c6b 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, \
More information about the ffmpeg-cvslog
mailing list