Browse code

lavfi: add avfilter_unref_bufferp()

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>

Robert Nagy authored on 2012/04/16 15:17:25
Showing 4 changed files
... ...
@@ -13,6 +13,9 @@ libavutil:   2011-04-18
13 13
 
14 14
 API changes, most recent first:
15 15
 
16
+2012-04-20 - xxxxxxx - lavfi 2.70.100
17
+  Add avfilter_unref_bufferp() to avfilter.h.
18
+
16 19
 2012-04-12 - xxxxxxx - lavfi 2.68.100
17 20
   Install libavfilter/asrc_abuffer.h public header.
18 21
 
... ...
@@ -160,6 +160,12 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref)
160 160
     av_free(ref);
161 161
 }
162 162
 
163
+void avfilter_unref_bufferp(AVFilterBufferRef **ref)
164
+{
165
+    avfilter_unref_buffer(*ref);
166
+    *ref = NULL;
167
+}
168
+
163 169
 void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
164 170
                          AVFilterPad **pads, AVFilterLink ***links,
165 171
                          AVFilterPad *newpad)
... ...
@@ -188,6 +188,15 @@ AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask);
188 188
 void avfilter_unref_buffer(AVFilterBufferRef *ref);
189 189
 
190 190
 /**
191
+ * Remove a reference to a buffer and set the pointer to NULL.
192
+ * If this is the last reference to the buffer, the buffer itself
193
+ * is also automatically freed.
194
+ *
195
+ * @param ref pointer to the buffer reference
196
+ */
197
+void avfilter_unref_bufferp(AVFilterBufferRef **ref);
198
+
199
+/**
191 200
  * A list of supported formats for one end of a filter link. This is used
192 201
  * during the format negotiation process to try to pick the best format to
193 202
  * use to minimize the number of necessary conversions. Each filter gives a
... ...
@@ -29,7 +29,7 @@
29 29
 #include "libavutil/avutil.h"
30 30
 
31 31
 #define LIBAVFILTER_VERSION_MAJOR  2
32
-#define LIBAVFILTER_VERSION_MINOR 70
32
+#define LIBAVFILTER_VERSION_MINOR 71
33 33
 #define LIBAVFILTER_VERSION_MICRO 100
34 34
 
35 35
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \