summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/renderer_libplacebo.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/render/renderer_libplacebo.c b/src/render/renderer_libplacebo.c
index 9fbcfc0..bd9a981 100644
--- a/src/render/renderer_libplacebo.c
+++ b/src/render/renderer_libplacebo.c
@@ -214,10 +214,10 @@ static bool renderer_lp_create_renderer(struct camu_renderer *renderer, u32 *wid
#if 0
struct nn_file file;
- if (nn_file_open(&file, al_str_c(""), 0)) {
- char *str;
- size_t len = nn_file_read_as_c_str(&file, &str);
- const struct pl_hook *hook = pl_mpv_user_shader_parse(lr->gpu, (const char *)str, len);
+ if (nn_file_open(&file, &al_str_c(""), 0)) {
+ char *c_str;
+ size_t length = nn_file_read_as_c_str(&file, &c_str);
+ const struct pl_hook *hook = pl_mpv_user_shader_parse(lr->gpu, (const char *)c_str, length);
const struct pl_hook **hooks = al_malloc(sizeof(struct pl_hook *));
hooks[0] = al_malloc(sizeof(struct pl_hook));
al_memcpy((void *)hooks[0], (void *)hook, sizeof(struct pl_hook));
@@ -311,11 +311,17 @@ static void renderer_lp_render(struct camu_renderer *renderer, struct camu_scree
do_gpu_finish |= weighted;
// Terrible hack. Let's us distinguish single frames with the same dimensions.
// Tied to a libplacebo patch to consider info_priv in the hash.
- // Add in last_pts to account for buffer resets. This is a completely
- // broken "hash" of the f64 pts value but hopefully works for now.
+ // Also, add in reset_pts to account for buffer resets. This is a completely
+ // broken "hash" of the f64 pts value but hopefully it works for now.
// https://www.virtualdub.org/blog2/entry_259.html
- f64 last_pts = camu_clock_get_last_pts(video->buf->clock);
- lr->params.info_priv = video->buf + (intptr_t)*((u64 *)&last_pts);
+ intptr_t hash = (intptr_t)video->buf;
+ union { f64 f; u64 u; } pts_hash;
+ pts_hash.f = video->buf->reset_pts;
+ hash += (intptr_t)pts_hash.u;
+#ifdef AL_WE_32BIT
+ hash += (intptr_t)(pts_hash.u >> 32);
+#endif
+ lr->params.info_priv = (void *)hash;
target->crop = mix.frames[0]->crop;
target->crop.x1 *= video->view.zoom / video->view.stretch;
target->crop.y1 *= video->view.zoom * video->view.stretch;