[vlc-commits] dxa9: initialize the GPU-mapped picture with no extra allocation
Steve Lhomme
git at videolan.org
Wed Jul 22 15:57:39 CEST 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul 22 15:50:51 2020 +0200| [3e0ba58fbc74ecd4cf0d29b1936ce9995cbdb37d] | committer: Steve Lhomme
dxa9: initialize the GPU-mapped picture with no extra allocation
We want the planes to be setup but not to allocate them because we will
overwrite them anyway. We don't need the extra picture_Setup(), it's done
for all pictures allocated.
They did not leak but were allocated for nothing.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3e0ba58fbc74ecd4cf0d29b1936ce9995cbdb37d
---
modules/hw/d3d9/dxa9.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c
index a654ffd1f1..563818dc70 100644
--- a/modules/hw/d3d9/dxa9.c
+++ b/modules/hw/d3d9/dxa9.c
@@ -347,12 +347,12 @@ static picture_t *AllocateCPUtoGPUTexture(filter_t *p_filter)
video_format_Copy(&fmt_staging, &p_filter->fmt_out.video);
fmt_staging.i_chroma = format;
- picture_t *p_dst = picture_NewFromFormat(&fmt_staging);
+ picture_resource_t dummy_res = {};
+ picture_t *p_dst = picture_NewFromResource(&fmt_staging, &dummy_res);
if (p_dst == NULL) {
msg_Err(p_filter, "Failed to map create the temporary picture.");
goto done;
}
- picture_Setup(p_dst, &p_dst->format);
pic_ctx->picsys.surface = texture;
p_dst->context = &pic_ctx->s;
return p_dst;
More information about the vlc-commits
mailing list