summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-01 01:34:55 +0200
committerwm4 <wm4@nowhere>2015-06-01 01:34:55 +0200
commitebde784fabe12791956cbe4a23a9e4bda4a4a205 (patch)
tree96d56cd4fe9b167c5d67627a8fd7bc6c028387aa /video/filter
parent8e010a500d4e7d74249606ee130f9e29d373fc5b (diff)
downloadmpv-ebde784fabe12791956cbe4a23a9e4bda4a4a205.tar.bz2
mpv-ebde784fabe12791956cbe4a23a9e4bda4a4a205.tar.xz
vf_vavpp: move vaMapBuffer() closer to its use
The mapped data (pointed to by the param variable) is not needed before, so the call can be moved down. Also, this prevents that the buffer remains mapped forever if the other vaMapBuffer() call above fails (the cleanup code forgets to unmap the buffer - this commit makes it unnecessary).
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf_vavpp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/video/filter/vf_vavpp.c b/video/filter/vf_vavpp.c
index c8b3bfdf25..770e68bfce 100644
--- a/video/filter/vf_vavpp.c
+++ b/video/filter/vf_vavpp.c
@@ -156,10 +156,6 @@ static struct mp_image *render(struct vf_instance *vf, struct mp_image *in,
if (!check_error(vf, status, "vaCreateBuffer()"))
goto cleanup;
- status = vaMapBuffer(p->display, buffer, (void**)&param);
- if (!check_error(vf, status, "vaMapBuffer()"))
- goto cleanup;
-
VAProcFilterParameterBufferDeinterlacing *filter_params;
status = vaMapBuffer(p->display, *(p->pipe.filters), (void**)&filter_params);
if (!check_error(vf, status, "vaMapBuffer()"))
@@ -171,6 +167,10 @@ static struct mp_image *render(struct vf_instance *vf, struct mp_image *in,
vaUnmapBuffer(p->display, *(p->pipe.filters));
+ status = vaMapBuffer(p->display, buffer, (void**)&param);
+ if (!check_error(vf, status, "vaMapBuffer()"))
+ goto cleanup;
+
param->surface = in_id;
param->surface_region = NULL;
param->output_region = NULL;