summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-15 19:12:39 +0200
committerwm4 <wm4@nowhere>2017-08-15 19:41:23 +0200
commit34ab0386cb1f28197ca11e90cd0236e352083758 (patch)
tree68c90a60549bcf65ef615d20d2d59fb745ba49f6 /video
parent935df644af755fdf17a47a61ee840f5baec33cd3 (diff)
downloadmpv-34ab0386cb1f28197ca11e90cd0236e352083758.tar.bz2
mpv-34ab0386cb1f28197ca11e90cd0236e352083758.tar.xz
vo_rpi: fix operation
Commit 697c4389a9e6 worked "almost". I couldn't test it at the time.
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/osd.c3
-rw-r--r--video/out/opengl/video.c5
-rw-r--r--video/out/opengl/video.h1
-rw-r--r--video/out/vo_rpi.c13
4 files changed, 17 insertions, 5 deletions
diff --git a/video/out/opengl/osd.c b/video/out/opengl/osd.c
index 374f737f41..c41e10d900 100644
--- a/video/out/opengl/osd.c
+++ b/video/out/opengl/osd.c
@@ -314,8 +314,6 @@ void mpgl_osd_draw_finish(struct mpgl_osd *ctx, int index,
gl_sc_blend(sc, factors[0], factors[1], factors[2], factors[3]);
gl_sc_dispatch_draw(sc, target.tex, part->vertices, part->num_vertices);
-
- ctx->change_flag = false;
}
static void set_res(struct mpgl_osd *ctx, struct mp_osd_res res, int stereo_mode)
@@ -359,6 +357,7 @@ void mpgl_osd_resize(struct mpgl_osd *ctx, struct mp_osd_res res, int stereo_mod
bool mpgl_osd_check_change(struct mpgl_osd *ctx, struct mp_osd_res *res,
double pts)
{
+ ctx->change_flag = false;
mpgl_osd_generate(ctx, *res, pts, 0, 0);
return ctx->change_flag;
}
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 791d1895a1..19b13d9349 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -3129,6 +3129,11 @@ void gl_video_set_clear_color(struct gl_video *p, struct m_color c)
p->clear_color = c;
}
+void gl_video_set_osd_pts(struct gl_video *p, double pts)
+{
+ p->osd_pts = pts;
+}
+
bool gl_video_check_osd_change(struct gl_video *p, struct mp_osd_res *res,
double pts)
{
diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h
index fd27c7a1bc..0db9773712 100644
--- a/video/out/opengl/video.h
+++ b/video/out/opengl/video.h
@@ -169,6 +169,7 @@ struct mp_csp_equalizer;
struct mp_csp_equalizer *gl_video_eq_ptr(struct gl_video *p);
void gl_video_eq_update(struct gl_video *p);
void gl_video_set_clear_color(struct gl_video *p, struct m_color color);
+void gl_video_set_osd_pts(struct gl_video *p, double pts);
bool gl_video_check_osd_change(struct gl_video *p, struct mp_osd_res *osd,
double pts);
diff --git a/video/out/vo_rpi.c b/video/out/vo_rpi.c
index 1a1e357feb..5b5d62c78f 100644
--- a/video/out/vo_rpi.c
+++ b/video/out/vo_rpi.c
@@ -260,13 +260,12 @@ static void update_osd(struct vo *vo)
MP_STATS(vo, "start rpi_osd");
- struct vo_frame frame = {
- .pts = p->osd_pts,
- };
+ struct vo_frame frame = {0};
struct fbodst target = {
.tex = ra_create_wrapped_fb(p->egl.ra, 0, p->osd_res.w, p->osd_res.h),
.flip = true,
};
+ gl_video_set_osd_pts(p->gl_video, p->osd_pts);
gl_video_render_frame(p->gl_video, &frame, target);
ra_tex_free(p->egl.ra, &target.tex);
@@ -317,6 +316,9 @@ static void resize(struct vo *vo)
if (mmal_port_parameter_set(input, &dr.hdr))
MP_WARN(vo, "could not set video rectangle\n");
+
+ if (p->gl_video)
+ gl_video_resize(p->gl_video, &src, &dst, &p->osd_res);
}
static void destroy_overlays(struct vo *vo)
@@ -411,6 +413,7 @@ static int create_overlays(struct vo *vo)
return -1;
}
p->gl_video = gl_video_init(p->egl.ra, vo->log, vo->global);
+ gl_video_set_clear_color(p->gl_video, (struct m_color){.a = 0});
gl_video_set_osd_source(p->gl_video, vo->osd);
}
@@ -432,6 +435,8 @@ static int create_overlays(struct vo *vo)
}
}
+ resize(vo);
+
vo_event(vo, VO_EVENT_WIN_STATE);
vc_dispmanx_update_submit_sync(p->update);
@@ -676,6 +681,8 @@ static int reconfig(struct vo *vo, struct mp_image_params *params)
return -1;
}
+ resize(vo);
+
return 0;
}