From 5e8b3e74ec19cfcae51c4d1b3df6a981af2dcd3d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 22 Dec 2012 18:07:54 +0100 Subject: vo_xv: fix OSD redrawing flicker redraw_frame() copied the image into the currently visible buffer. This resulted in flicker when doing heavy OSD redrawing (like changing the subtitle size to something absurdly large). Use the same logic as draw_image instead. --- video/out/vo_xv.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'video') diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c index 7a454e33c4..de1f3a4855 100644 --- a/video/out/vo_xv.c +++ b/video/out/vo_xv.c @@ -388,19 +388,6 @@ static void draw_osd(struct vo *vo, struct osd_state *osd) osd_draw_on_image(osd, res, osd->vo_pts, 0, &img); } -static int redraw_frame(struct vo *vo) -{ - struct xvctx *ctx = vo->priv; - - if (!ctx->original_image) - return false; - - struct mp_image img = get_xv_buffer(vo, ctx->visible_buf); - mp_image_copy(&img, ctx->original_image); - ctx->current_buf = ctx->visible_buf; - return true; -} - static void flip_page(struct vo *vo) { struct xvctx *ctx = vo->priv; @@ -436,6 +423,17 @@ static void draw_image(struct vo *vo, mp_image_t *mpi) mp_image_setrefp(&ctx->original_image, mpi); } +static int redraw_frame(struct vo *vo) +{ + struct xvctx *ctx = vo->priv; + + if (!ctx->original_image) + return false; + + draw_image(vo, ctx->original_image); + return true; +} + static int query_format(struct vo *vo, uint32_t format) { struct xvctx *ctx = vo->priv; -- cgit v1.2.3