[vlc-commits] directdraw: add picture destroy callback
Rémi Denis-Courmont
git at videolan.org
Wed Dec 12 19:44:04 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 12 20:34:32 2018 +0200| [47dfca357237ad3184e19d4b89a1b2419b514eb4] | committer: Rémi Denis-Courmont
directdraw: add picture destroy callback
Since there is something to free.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=47dfca357237ad3184e19d4b89a1b2419b514eb4
---
modules/video_output/win32/directdraw.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/modules/video_output/win32/directdraw.c b/modules/video_output/win32/directdraw.c
index b87b91cb91..b87726d0bf 100644
--- a/modules/video_output/win32/directdraw.c
+++ b/modules/video_output/win32/directdraw.c
@@ -1281,6 +1281,10 @@ static void DirectXUnlock(picture_t *picture)
DirectXUnlockSurface(p_sys->front_surface,
p_sys->surface);
}
+static void DirectXDestroyPicture(picture_t *picture)
+{
+ free(picture->p_sys);
+}
static int DirectXCreatePool(vout_display_t *vd,
bool *use_overlay, video_format_t *fmt)
@@ -1294,7 +1298,9 @@ static int DirectXCreatePool(vout_display_t *vd,
return VLC_EGENERIC;
/* Create the associated picture */
- picture_resource_t resource = { .p_sys = sys->picsys };
+ picture_resource_t resource = {
+ .p_sys = sys->picsys, .pf_destroy = DirectXDestroyPicture,
+ };
picture_t *picture = picture_NewFromResource(fmt, &resource);
if (!picture) {
DirectXDestroyPictureResource(vd);
More information about the vlc-commits
mailing list