mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
3d6d549dac
commit
5e8b3e74ec
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue