summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-02-28 00:48:48 +0100
committerwm4 <wm4@nowhere>2017-02-28 00:57:51 +0100
commitd015aab42835d20679ec4fe0d8b3a31a81f7a168 (patch)
treed2c8843bc340fae94b6281df88656e35aac3a3cb
parent4fe199c6a06606b0191575b3a0127076135a952c (diff)
downloadmpv-d015aab42835d20679ec4fe0d8b3a31a81f7a168.tar.bz2
mpv-d015aab42835d20679ec4fe0d8b3a31a81f7a168.tar.xz
vf_vavpp: minor fixes
Fully initialize two structs (not doing so may or may not have been a bug). Actually destroy the VABufferID we create (moderate memory leak).
-rw-r--r--video/filter/vf_vavpp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/video/filter/vf_vavpp.c b/video/filter/vf_vavpp.c
index e6dfaa3c6a..35172f0344 100644
--- a/video/filter/vf_vavpp.c
+++ b/video/filter/vf_vavpp.c
@@ -157,6 +157,7 @@ static struct mp_image *render(struct vf_instance *vf)
struct mp_image *img = NULL;
bool need_end_picture = false;
bool success = false;
+ VABufferID buffer = VA_INVALID_ID;
VASurfaceID in_id = va_surface_id(in);
if (!p->pipe.filters || in_id == VA_INVALID_ID)
@@ -189,7 +190,6 @@ static struct mp_image *render(struct vf_instance *vf)
need_end_picture = true;
- VABufferID buffer = VA_INVALID_ID;
VAProcPipelineParameterBuffer *param = NULL;
status = vaCreateBuffer(p->display, p->context,
VAProcPipelineParameterBufferType,
@@ -212,6 +212,7 @@ static struct mp_image *render(struct vf_instance *vf)
if (!check_error(vf, status, "vaMapBuffer()"))
goto cleanup;
+ *param = (VAProcPipelineParameterBuffer){0};
param->surface = in_id;
param->surface_region = &(VARectangle){0, 0, in->w, in->h};
param->output_region = &(VARectangle){0, 0, img->w, img->h};
@@ -239,6 +240,7 @@ static struct mp_image *render(struct vf_instance *vf)
cleanup:
if (need_end_picture)
vaEndPicture(p->display, p->context);
+ vaDestroyBuffer(p->display, buffer);
if (success)
return img;
talloc_free(img);
@@ -427,7 +429,7 @@ static bool initialize(struct vf_instance *vf)
for (int n=0; n < num; n++) { // find the algorithm
if (caps[n].type != algorithm)
continue;
- VAProcFilterParameterBufferDeinterlacing param;
+ VAProcFilterParameterBufferDeinterlacing param = {0};
param.type = VAProcFilterDeinterlacing;
param.algorithm = algorithm;
buffers[VAProcFilterDeinterlacing] =