diff options
Diffstat (limited to 'sub')
-rw-r--r-- | sub/osd.c | 19 | ||||
-rw-r--r-- | sub/osd.h | 2 | ||||
-rw-r--r-- | sub/osd_state.h | 1 |
3 files changed, 22 insertions, 0 deletions
@@ -119,6 +119,7 @@ struct osd_state *osd_create(struct mpv_global *global) .opts = global->opts, .global = global, .log = mp_log_new(osd, global->log, "osd"), + .force_video_pts = MP_NOPTS_VALUE, }; pthread_mutex_init(&osd->lock, NULL); @@ -190,6 +191,21 @@ void osd_set_render_subs_in_filter(struct osd_state *osd, bool s) pthread_mutex_unlock(&osd->lock); } +void osd_set_force_video_pts(struct osd_state *osd, double video_pts) +{ + pthread_mutex_lock(&osd->lock); + osd->force_video_pts = video_pts; + pthread_mutex_unlock(&osd->lock); +} + +double osd_get_force_video_pts(struct osd_state *osd) +{ + pthread_mutex_lock(&osd->lock); + double pts = osd->force_video_pts; + pthread_mutex_unlock(&osd->lock); + return pts; +} + void osd_set_progbar(struct osd_state *osd, struct osd_progbar_state *s) { pthread_mutex_lock(&osd->lock); @@ -288,6 +304,9 @@ void osd_draw(struct osd_state *osd, struct mp_osd_res res, { pthread_mutex_lock(&osd->lock); + if (osd->force_video_pts != MP_NOPTS_VALUE) + video_pts = osd->force_video_pts; + if (draw_flags & OSD_DRAW_SUB_FILTER) draw_flags |= OSD_DRAW_SUB_ONLY; @@ -155,6 +155,8 @@ void osd_set_sub(struct osd_state *osd, int index, struct dec_sub *dec_sub); bool osd_get_render_subs_in_filter(struct osd_state *osd); void osd_set_render_subs_in_filter(struct osd_state *osd, bool s); +void osd_set_force_video_pts(struct osd_state *osd, double video_pts); +double osd_get_force_video_pts(struct osd_state *osd); struct osd_progbar_state { int type; // <0: disabled, 1-255: symbol, else: no symbol diff --git a/sub/osd_state.h b/sub/osd_state.h index fbccd85e70..cce415a1b9 100644 --- a/sub/osd_state.h +++ b/sub/osd_state.h @@ -67,6 +67,7 @@ struct osd_state { struct osd_object *objs[MAX_OSD_PARTS]; bool render_subs_in_filter; + double force_video_pts; bool want_redraw; bool want_redraw_notification; |