Commit 7014eb52 authored by Niklas Haas's avatar Niklas Haas
Browse files

utils/dav1d: check for PL_GPU_CAP_CALLBACKS

We should avoid setting any callbacks if this capability is not present.
parent 7b0df083
......@@ -415,7 +415,7 @@ static inline bool pl_upload_dav1dpicture(const struct pl_gpu *gpu,
// Re-use pre-allocated buffers directly
assert(alloc->gpu == gpu);
buf = alloc->buf;
} else if (params->asynchronous) {
} else if (params->asynchronous && (gpu->caps & PL_GPU_CAP_CALLBACKS)) {
ref = malloc(sizeof(*ref));
if (!ref)
return false;
......@@ -441,8 +441,13 @@ static inline bool pl_upload_dav1dpicture(const struct pl_gpu *gpu,
}
}
if (ref)
*pic = (Dav1dPicture) {0};
if (params->asynchronous) {
if (ref) {
*pic = (Dav1dPicture) {0};
} else {
dav1d_picture_unref(pic);
}
}
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment