summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vdpau.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_vdpau.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_vdpau.c')
-rw-r--r--video/out/vo_vdpau.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 3deac1724b..406ed5f9ed 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -145,6 +145,7 @@ struct vdpctx {
};
static bool status_ok(struct vo *vo);
+static void draw_osd(struct vo *vo);
static int render_video_to_output_surface(struct vo *vo,
VdpOutputSurface output_surface,
@@ -214,9 +215,11 @@ static int video_to_output_surface(struct vo *vo)
{
struct vdpctx *vc = vo->priv;
- return render_video_to_output_surface(vo,
- vc->output_surfaces[vc->surface_num],
- &vc->out_rect_vid, &vc->src_rect_vid);
+ int r = render_video_to_output_surface(vo,
+ vc->output_surfaces[vc->surface_num],
+ &vc->out_rect_vid, &vc->src_rect_vid);
+ draw_osd(vo);
+ return r;
}
static void forget_frames(struct vo *vo, bool seek_reset)
@@ -657,7 +660,7 @@ static void draw_osd_cb(void *ctx, struct sub_bitmaps *imgs)
draw_osd_part(vo, imgs->render_index);
}
-static void draw_osd(struct vo *vo, struct osd_state *osd)
+static void draw_osd(struct vo *vo)
{
struct vdpctx *vc = vo->priv;
@@ -669,7 +672,8 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
[SUBBITMAP_RGBA] = true,
};
- osd_draw(osd, vc->osd_rect, osd_get_vo_pts(osd), 0, formats, draw_osd_cb, vo);
+ double pts = vc->current_image ? vc->current_image->pts : 0;
+ osd_draw(vo->osd, vc->osd_rect, pts, 0, formats, draw_osd_cb, vo);
}
static int update_presentation_queue_status(struct vo *vo)
@@ -1141,7 +1145,6 @@ const struct vo_driver video_out_vdpau = {
.control = control,
.draw_image = draw_image,
.filter_image = filter_image,
- .draw_osd = draw_osd,
.flip_page_timed = flip_page_timed,
.uninit = uninit,
.priv_size = sizeof(struct vdpctx),