[FFmpeg-cvslog] Revert "lavu/buffer: add release function"
Lukasz Marek
git at videolan.org
Tue Mar 11 11:01:28 CET 2014
ffmpeg | branch: release/2.2 | Lukasz Marek <lukasz.m.luki at gmail.com> | Sun Mar 2 17:47:19 2014 +0100| [3171e2360aaeb0f0a3c2848dcf6426f1d40d5ed8] | committer: Michael Niedermayer
Revert "lavu/buffer: add release function"
This reverts commit 3144440004941aa22ffea9933f5e5dfe826df654.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit bba7b6fc41057d4aec6b1f0e12240db56fe6e9b6)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3171e2360aaeb0f0a3c2848dcf6426f1d40d5ed8
---
libavutil/buffer.c | 29 -----------------------------
libavutil/buffer.h | 12 ------------
2 files changed, 41 deletions(-)
diff --git a/libavutil/buffer.c b/libavutil/buffer.c
index e8ec2c9..e9bf54b 100644
--- a/libavutil/buffer.c
+++ b/libavutil/buffer.c
@@ -117,35 +117,6 @@ void av_buffer_unref(AVBufferRef **buf)
}
}
-int av_buffer_release(AVBufferRef **buf, uint8_t **data)
-{
- AVBuffer *b;
- int ret = 0;
-
- if (data)
- *data = NULL;
- if (!buf || !*buf)
- return 0;
- b = (*buf)->buffer;
- av_freep(buf);
-
- if (data && avpriv_atomic_int_get(&b->refcount) > 1) {
- *data = av_memdup(b->data, b->size);
- if (!*data)
- ret = AVERROR(ENOMEM);
- }
-
- if (!avpriv_atomic_int_add_and_fetch(&b->refcount, -1)) {
- if (data && !*data) {
- ret = 0;
- *data = b->data;
- } else
- b->free(b->opaque, b->data);
- av_freep(&b);
- }
- return ret;
-}
-
int av_buffer_is_writable(const AVBufferRef *buf)
{
if (buf->buffer->flags & AV_BUFFER_FLAG_READONLY)
diff --git a/libavutil/buffer.h b/libavutil/buffer.h
index 8cf2cbf..b4399fd 100644
--- a/libavutil/buffer.h
+++ b/libavutil/buffer.h
@@ -155,18 +155,6 @@ AVBufferRef *av_buffer_ref(AVBufferRef *buf);
void av_buffer_unref(AVBufferRef **buf);
/**
- * Free a given reference and pass underlaying data to user provided pointer.
- * If there is more than one reference then data is copied.
- *
- * @param buf the reference to be released. The pointer is set to NULL on return.
- * @param data pointer to be passed with underlaying data.
- * @return 0 on success, a negative AVERROR on failure.
- *
- * @note on error buffer is properly released and *data is set to NULL.
- */
-int av_buffer_release(AVBufferRef **buf, uint8_t **data);
-
-/**
* @return 1 if the caller may write to the data referred to by buf (which is
* true if and only if buf is the only reference to the underlying AVBuffer).
* Return 0 otherwise.
More information about the ffmpeg-cvslog
mailing list