summaryrefslogtreecommitdiffstats
path: root/sub/sub.c
diff options
context:
space:
mode:
Diffstat (limited to 'sub/sub.c')
-rw-r--r--sub/sub.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sub/sub.c b/sub/sub.c
index 8fde350d4d..dd8c887b4c 100644
--- a/sub/sub.c
+++ b/sub/sub.c
@@ -262,6 +262,7 @@ void osd_draw(struct osd_state *osd, struct mp_osd_res res,
struct draw_on_image_closure {
struct osd_state *osd;
struct mp_image *dest;
+ struct mp_draw_sub_backup *bk;
bool changed;
};
@@ -269,6 +270,8 @@ static void draw_on_image(void *ctx, struct sub_bitmaps *imgs)
{
struct draw_on_image_closure *closure = ctx;
struct osd_state *osd = closure->osd;
+ if (closure->bk)
+ mp_draw_sub_backup_add(closure->bk, closure->dest, imgs);
mp_draw_sub_bitmaps(&osd->draw_cache, closure->dest, imgs);
talloc_steal(osd, osd->draw_cache);
closure->changed = true;
@@ -284,6 +287,15 @@ bool osd_draw_on_image(struct osd_state *osd, struct mp_osd_res res,
return closure.changed;
}
+void osd_draw_on_image_bk(struct osd_state *osd, struct mp_osd_res res,
+ double video_pts, int draw_flags,
+ struct mp_draw_sub_backup *bk, struct mp_image *dest)
+{
+ struct draw_on_image_closure closure = {osd, dest, bk};
+ osd_draw(osd, res, video_pts, draw_flags, mp_draw_sub_formats,
+ &draw_on_image, &closure);
+}
+
void vo_osd_changed(int new_value)
{
struct osd_state *osd = global_osd;