diff options
Diffstat (limited to 'video/out/vo_vaapi.c')
-rw-r--r-- | video/out/vo_vaapi.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c index 35caf4d9c6..df96121137 100644 --- a/video/out/vo_vaapi.c +++ b/video/out/vo_vaapi.c @@ -111,6 +111,8 @@ static const bool osd_formats[SUBBITMAP_COUNT] = { [SUBBITMAP_RGBA] = true, }; +static void draw_osd(struct vo *vo); + static void flush_output_surfaces(struct priv *p) { for (int n = 0; n < MAX_OUTPUT_SURFACES; n++) @@ -283,6 +285,8 @@ static void draw_image(struct vo *vo, struct mp_image *mpi) } mp_image_setrefp(&p->output_surfaces[p->output_surface], mpi); + + draw_osd(vo); } static struct mp_image *get_screenshot(struct priv *p) @@ -407,10 +411,13 @@ error: ; } -static void draw_osd(struct vo *vo, struct osd_state *osd) +static void draw_osd(struct vo *vo) { struct priv *p = vo->priv; + struct mp_image *cur = p->output_surfaces[p->output_surface]; + double pts = cur ? cur->pts : 0; + if (!p->osd_format.fourcc) return; @@ -425,7 +432,7 @@ static void draw_osd(struct vo *vo, struct osd_state *osd) for (int n = 0; n < MAX_OSD_PARTS; n++) p->osd_parts[n].active = false; - osd_draw(osd, *res, osd_get_vo_pts(osd), 0, osd_formats, draw_osd_cb, p); + osd_draw(vo->osd, *res, pts, 0, osd_formats, draw_osd_cb, p); } static int get_displayattribtype(const char *name) @@ -524,6 +531,7 @@ static int control(struct vo *vo, uint32_t request, void *data) } case VOCTRL_REDRAW_FRAME: p->output_surface = p->visible_surface; + draw_osd(vo); return true; case VOCTRL_SCREENSHOT: { struct voctrl_screenshot_args *args = data; @@ -654,7 +662,6 @@ const struct vo_driver video_out_vaapi = { .reconfig = reconfig, .control = control, .draw_image = draw_image, - .draw_osd = draw_osd, .flip_page = flip_page, .uninit = uninit, .priv_size = sizeof(struct priv), |