mirror of
https://github.com/mpv-player/mpv
synced 2024-12-25 08:12:17 +00:00
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).
This commit is contained in:
parent
8e010a500d
commit
ebde784fab
@ -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**)¶m);
|
||||
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**)¶m);
|
||||
if (!check_error(vf, status, "vaMapBuffer()"))
|
||||
goto cleanup;
|
||||
|
||||
param->surface = in_id;
|
||||
param->surface_region = NULL;
|
||||
param->output_region = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user