mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
avutil/buffer: add av_buffer_pool_buffer_get_opaque
In order to access the original opaque parameter of a buffer in the buffer pool. (The buffer pool implementation overrides the normal opaque parameter but also saves it so it is accessible). v2: add assertion check before dereferencing the BufferPoolEntry. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
e3dca0744d
commit
16685114d5
4 changed files with 26 additions and 2 deletions
|
|
@ -20,6 +20,7 @@
|
|||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "avassert.h"
|
||||
#include "buffer_internal.h"
|
||||
#include "common.h"
|
||||
#include "mem.h"
|
||||
|
|
@ -355,3 +356,10 @@ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool)
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void *av_buffer_pool_buffer_get_opaque(AVBufferRef *ref)
|
||||
{
|
||||
BufferPoolEntry *buf = ref->buffer->opaque;
|
||||
av_assert0(buf);
|
||||
return buf->opaque;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue