sub/osd: change osd_set_external2 into generic osd_set_bitmaps

Let the caller pick the OSD object instead of hardcoding EXTERNAL2, so
other bitmap overlay sources can reuse the same path. No functional
change, EXTERNAL2 is still the only user.
This commit is contained in:
Kacper Michajłow committed 2026-08-26 01:47:41 +02:00
1 parent fbca538bfe
commit b573edaaa1
3 files changed
+5 -5

No files matched your search

+2 -2
View File
@@ -5374,7 +5374,7 @@ done:
new->num_parts = 0;
}
osd_set_external2(mpctx->osd, new);
osd_set_bitmaps(mpctx->osd, OSDTYPE_EXTERNAL2, new);
mp_wakeup_core(mpctx);
cmd->overlay_osd_current = overlay_next;
}
@@ -5523,7 +5523,7 @@ static void overlay_uninit(struct MPContext *mpctx)
return;
for (int id = 0; id < cmd->num_overlays; id++)
replace_overlay(mpctx, id, &(struct overlay){0});
osd_set_external2(mpctx->osd, NULL);
osd_set_bitmaps(mpctx->osd, OSDTYPE_EXTERNAL2, NULL);
for (int n = 0; n < 2; n++)
mp_image_unrefp(&cmd->overlay_osd[n].packed);
}
+2 -2
View File
@@ -274,10 +274,10 @@ void osd_set_progbar(struct osd_state *osd, struct osd_progbar_state *s)
mp_mutex_unlock(&osd->lock);
}
void osd_set_external2(struct osd_state *osd, struct sub_bitmaps *imgs)
void osd_set_bitmaps(struct osd_state *osd, int type, struct sub_bitmaps *imgs)
{
mp_mutex_lock(&osd->lock);
struct osd_object *obj = osd->objs[OSDTYPE_EXTERNAL2];
struct osd_object *obj = osd->objs[type];
talloc_free(obj->external2);
obj->external2 = sub_bitmaps_copy(NULL, imgs);
obj->vo_change_id += 1;
+1 -1
View File
@@ -219,7 +219,7 @@ struct osd_progbar_state {
};
void osd_set_progbar(struct osd_state *osd, struct osd_progbar_state *s);
void osd_set_external2(struct osd_state *osd, struct sub_bitmaps *imgs);
void osd_set_bitmaps(struct osd_state *osd, int type, struct sub_bitmaps *imgs);
enum mp_osd_draw_flags {
OSD_DRAW_SUB_FILTER = (1 << 0),