diff options
author | wm4 <wm4@nowhere> | 2017-08-11 13:02:13 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-08-11 21:29:35 +0200 |
commit | 697c4389a9e650935cee934009bdbd42dc4e5cfa (patch) | |
tree | ca9fc5d3ab28e70c42e78c9ac3eb4c9cb9b9cd32 /video/out/opengl/osd.c | |
parent | de3eecce7fabc23eb76558310040d54fd2528254 (diff) | |
download | mpv-697c4389a9e650935cee934009bdbd42dc4e5cfa.tar.bz2 mpv-697c4389a9e650935cee934009bdbd42dc4e5cfa.tar.xz |
rpi: fix build
Runtime untested, because I get this:
[vo/rpi] Could not get DISPMANX objects.
This happened even when building older git versions, and on a RPI image
that hasn't changed in the recent years. I don't know how to make this
POS work again, so I guess if there's a bug in the new code, it will
remain broken.
Diffstat (limited to 'video/out/opengl/osd.c')
-rw-r--r-- | video/out/opengl/osd.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/video/out/opengl/osd.c b/video/out/opengl/osd.c index 2678e12774..7030e8d8f4 100644 --- a/video/out/opengl/osd.c +++ b/video/out/opengl/osd.c @@ -66,7 +66,7 @@ struct mpgl_osd { struct mpgl_osd_part *parts[MAX_OSD_PARTS]; const struct ra_format *fmt_table[SUBBITMAP_COUNT]; bool formats[SUBBITMAP_COUNT]; - int64_t change_counter; + bool change_flag; // for reporting to API user only // temporary int stereo_mode; struct mp_osd_res osd_res; @@ -81,6 +81,7 @@ struct mpgl_osd *mpgl_osd_init(struct ra *ra, struct mp_log *log, .log = log, .osd = osd, .ra = ra, + .change_flag = true, .scratch = talloc_zero_size(ctx, 1), }; @@ -189,7 +190,7 @@ static void gen_osd_cb(void *pctx, struct sub_bitmaps *imgs) ok = false; osd->change_id = imgs->change_id; - ctx->change_counter += 1; + ctx->change_flag = true; } osd->num_subparts = ok ? imgs->num_parts : 0; @@ -310,6 +311,8 @@ void mpgl_osd_draw_finish(struct mpgl_osd *ctx, int index, gl_sc_blend(sc, factors[0], factors[1], factors[2], factors[3]); gl_sc_dispatch_draw(sc, target.tex, part->vertices, part->num_vertices); + + ctx->change_flag = false; } static void set_res(struct mpgl_osd *ctx, struct mp_osd_res res, int stereo_mode) @@ -338,7 +341,7 @@ void mpgl_osd_generate(struct mpgl_osd *ctx, struct mp_osd_res res, double pts, for (int n = 0; n < MAX_OSD_PARTS; n++) { struct mpgl_osd_part *part = ctx->parts[n]; if (part->num_subparts != part->prev_num_subparts) - ctx->change_counter += 1; + ctx->change_flag = true; part->prev_num_subparts = part->num_subparts; } } @@ -350,7 +353,9 @@ void mpgl_osd_resize(struct mpgl_osd *ctx, struct mp_osd_res res, int stereo_mod osd_resize(ctx->osd, ctx->osd_res); } -int64_t mpgl_get_change_counter(struct mpgl_osd *ctx) +bool mpgl_osd_check_change(struct mpgl_osd *ctx, struct mp_osd_res *res, + double pts) { - return ctx->change_counter; + mpgl_osd_generate(ctx, *res, pts, 0, 0); + return ctx->change_flag; } |