summaryrefslogtreecommitdiffstats
path: root/video/out/vo_xv.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-15 20:46:57 +0200
committerwm4 <wm4@nowhere>2014-06-15 20:53:15 +0200
commit716285782d5e4b264e18e253e9d58980183c76c6 (patch)
treeb03e6e0ead71828f9d68bdebe777a808bee5d26f /video/out/vo_xv.c
parentd88aca6fb2474617136b09c2f281860d6a0a1a38 (diff)
downloadmpv-716285782d5e4b264e18e253e9d58980183c76c6.tar.bz2
mpv-716285782d5e4b264e18e253e9d58980183c76c6.tar.xz
video/out: change aspects of OSD handling
Let the VOs draw the OSD on their own, instead of making OSD drawing a separate VO driver call. Further, let it be the VOs responsibility to request subtitles with the correct PTS. We also basically allow the VO to request OSD/subtitles at any time. OSX changes untested.
Diffstat (limited to 'video/out/vo_xv.c')
-rw-r--r--video/out/vo_xv.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index bf564cb136..e353dc27ff 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -615,16 +615,6 @@ static struct mp_image get_xv_buffer(struct vo *vo, int buf_index)
return img;
}
-static void draw_osd(struct vo *vo, struct osd_state *osd)
-{
- struct xvctx *ctx = vo->priv;
-
- struct mp_image img = get_xv_buffer(vo, ctx->current_buf);
-
- struct mp_osd_res res = osd_res_from_image_params(vo->params);
- osd_draw_on_image(osd, res, osd_get_vo_pts(osd), 0, &img);
-}
-
static void wait_for_completion(struct vo *vo, int max_outstanding)
{
#if HAVE_SHM && HAVE_XEXT
@@ -679,6 +669,9 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
mp_image_clear(&xv_buffer, 0, 0, xv_buffer.w, xv_buffer.h);
}
+ struct mp_osd_res res = osd_res_from_image_params(vo->params);
+ osd_draw_on_image(vo->osd, res, mpi ? mpi->pts : 0, 0, &xv_buffer);
+
mp_image_setrefp(&ctx->original_image, mpi);
}
@@ -891,7 +884,6 @@ const struct vo_driver video_out_xv = {
.reconfig = reconfig,
.control = control,
.draw_image = draw_image,
- .draw_osd = draw_osd,
.flip_page = flip_page,
.uninit = uninit,
.priv_size = sizeof(struct xvctx),