diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavutil/buffer.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavutil/buffer.c')
| -rw-r--r-- | ffmpeg/libavutil/buffer.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ffmpeg/libavutil/buffer.c b/ffmpeg/libavutil/buffer.c index fc389a5..e9bf54b 100644 --- a/ffmpeg/libavutil/buffer.c +++ b/ffmpeg/libavutil/buffer.c @@ -125,6 +125,16 @@ int av_buffer_is_writable(const AVBufferRef *buf) return avpriv_atomic_int_get(&buf->buffer->refcount) == 1; } +void *av_buffer_get_opaque(const AVBufferRef *buf) +{ + return buf->buffer->opaque; +} + +int av_buffer_get_ref_count(const AVBufferRef *buf) +{ + return buf->buffer->refcount; +} + int av_buffer_make_writable(AVBufferRef **pbuf) { AVBufferRef *newbuf, *buf = *pbuf; @@ -276,6 +286,10 @@ static void pool_release_buffer(void *opaque, uint8_t *data) { BufferPoolEntry *buf = opaque; AVBufferPool *pool = buf->pool; + + if(CONFIG_MEMORY_POISONING) + memset(buf->data, FF_MEMORY_POISON, pool->size); + add_to_pool(buf); if (!avpriv_atomic_int_add_and_fetch(&pool->refcount, -1)) buffer_pool_free(pool); |
