Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Bradshaw <mjbshaw@google.com>2018-12-14 03:57:49 +0300
committerMichael Bradshaw <mjbshaw@google.com>2019-01-05 20:24:12 +0300
commitc7007c923a825f4d6b928e7afc24a6b1d6bcc98d (patch)
tree5f9754ab4437210d96d476e6ad321ca54335b6e6 /src/picture.c
parent9ea56386dee2706d94f3c2dac1720bcf4961aaba (diff)
Add a user data pointer to Dav1dDataProps
Diffstat (limited to 'src/picture.c')
-rw-r--r--src/picture.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/picture.c b/src/picture.c
index c6744d3..510d002 100644
--- a/src/picture.c
+++ b/src/picture.c
@@ -92,8 +92,10 @@ struct pic_ctx_context {
static void free_buffer(const uint8_t *const data, void *const user_data) {
struct pic_ctx_context *pic_ctx = user_data;
+ struct Dav1dRef *user_data_ref = pic_ctx->pic.m.user_data.ref;
pic_ctx->allocator.release_picture_callback(&pic_ctx->pic,
pic_ctx->allocator.cookie);
+ if (user_data_ref) dav1d_ref_dec(&user_data_ref);
free(pic_ctx);
}
@@ -120,6 +122,8 @@ static int picture_alloc_with_edges(Dav1dPicture *const p,
p->m.timestamp = INT64_MIN;
p->m.duration = 0;
p->m.offset = -1;
+ p->m.user_data.data = NULL;
+ p->m.user_data.ref = NULL;
p->p.layout = layout;
p->p.bpc = bpc;
int res = p_allocator->alloc_picture_callback(p, p_allocator->cookie);
@@ -176,7 +180,7 @@ int dav1d_picture_alloc_copy(Dav1dPicture *const dst, const int w,
if (!res) {
dst->p = src->p;
- dst->m = src->m;
+ dav1d_data_props_copy(&dst->m, &src->m);
dst->p.w = w;
dst->frame_hdr = src->frame_hdr;
dst->frame_hdr_ref = src->frame_hdr_ref;