diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-11-24 01:07:00 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-11-28 10:46:16 +0100 |
commit | c78f0237ef17eb1313cdd7960ad688a1e31c4e16 (patch) | |
tree | 6ee22c8b5af8212a888969b282ce07eb6b7c0c14 /video/out/gpu/video.c | |
parent | 3b1cb5d6aa21d3534e1de1acb42226b7f729fd30 (diff) | |
download | mpv-c78f0237ef17eb1313cdd7960ad688a1e31c4e16.tar.bz2 mpv-c78f0237ef17eb1313cdd7960ad688a1e31c4e16.tar.xz |
vo_gpu: don't pass gl_user_shader_hook by value
Diffstat (limited to 'video/out/gpu/video.c')
-rw-r--r-- | video/out/gpu/video.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index fe679e662a..ab947c4452 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -2048,25 +2048,23 @@ static void user_hook(struct gl_video *p, struct image img, gl_transform_trans(shader->offset, trans); } -static bool add_user_hook(void *priv, struct gl_user_shader_hook hook) +static bool add_user_hook(void *priv, const struct gl_user_shader_hook *hook) { struct gl_video *p = priv; - struct gl_user_shader_hook *copy = talloc_ptrtype(p, copy); - *copy = hook; - + struct gl_user_shader_hook *copy = talloc_dup(p, (struct gl_user_shader_hook *)hook); struct tex_hook texhook = { - .save_tex = bstrdup0(copy, hook.save_tex), - .components = hook.components, - .align_offset = hook.align_offset, + .save_tex = bstrdup0(copy, copy->save_tex), + .components = copy->components, + .align_offset = copy->align_offset, .hook = user_hook, .cond = user_hook_cond, .priv = copy, }; for (int h = 0; h < SHADER_MAX_HOOKS; h++) - texhook.hook_tex[h] = bstrdup0(copy, hook.hook_tex[h]); + texhook.hook_tex[h] = bstrdup0(copy, copy->hook_tex[h]); for (int h = 0; h < SHADER_MAX_BINDS; h++) - texhook.bind_tex[h] = bstrdup0(copy, hook.bind_tex[h]); + texhook.bind_tex[h] = bstrdup0(copy, copy->bind_tex[h]); MP_TARRAY_APPEND(p, p->tex_hooks, p->num_tex_hooks, texhook); return true; |