summaryrefslogtreecommitdiffstats
path: root/video/out/vo.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/vo.c')
-rw-r--r--video/out/vo.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 76f980ce5a..98601f0324 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -152,7 +152,7 @@ static int event_fd_callback(void *ctx, int fd)
}
static struct vo *vo_create(struct mpv_global *global,
- struct input_ctx *input_ctx,
+ struct input_ctx *input_ctx, struct osd_state *osd,
struct encode_lavc_context *encode_lavc_ctx,
char *name, char **args)
{
@@ -171,6 +171,7 @@ static struct vo *vo_create(struct mpv_global *global,
.global = global,
.encode_lavc_ctx = encode_lavc_ctx,
.input_ctx = input_ctx,
+ .osd = osd,
.event_fd = -1,
.monitor_par = 1,
.max_video_queue = 1,
@@ -198,6 +199,7 @@ error:
struct vo *init_best_video_out(struct mpv_global *global,
struct input_ctx *input_ctx,
+ struct osd_state *osd,
struct encode_lavc_context *encode_lavc_ctx)
{
struct m_obj_settings *vo_list = global->opts->vo.video_driver_list;
@@ -207,7 +209,7 @@ struct vo *init_best_video_out(struct mpv_global *global,
// Something like "-vo name," allows fallback to autoprobing.
if (strlen(vo_list[n].name) == 0)
goto autoprobe;
- struct vo *vo = vo_create(global, input_ctx, encode_lavc_ctx,
+ struct vo *vo = vo_create(global, input_ctx, osd, encode_lavc_ctx,
vo_list[n].name, vo_list[n].attribs);
if (vo)
return vo;
@@ -217,7 +219,7 @@ struct vo *init_best_video_out(struct mpv_global *global,
autoprobe:
// now try the rest...
for (int i = 0; video_out_drivers[i]; i++) {
- struct vo *vo = vo_create(global, input_ctx, encode_lavc_ctx,
+ struct vo *vo = vo_create(global, input_ctx, osd, encode_lavc_ctx,
(char *)video_out_drivers[i]->name, NULL);
if (vo)
return vo;
@@ -321,15 +323,6 @@ double vo_get_next_pts(struct vo *vo, int index)
return vo->video_queue[index]->pts;
}
-int vo_redraw_frame(struct vo *vo)
-{
- if (vo->config_ok && vo_control(vo, VOCTRL_REDRAW_FRAME, NULL) == true) {
- vo->want_redraw = false;
- return 0;
- }
- return -1;
-}
-
bool vo_get_want_redraw(struct vo *vo)
{
return vo->config_ok && vo->want_redraw;
@@ -354,12 +347,6 @@ void vo_new_frame_imminent(struct vo *vo)
vo->hasframe = true;
}
-void vo_draw_osd(struct vo *vo, struct osd_state *osd)
-{
- if (vo->config_ok && vo->driver->draw_osd)
- vo->driver->draw_osd(vo, osd);
-}
-
void vo_flip_page(struct vo *vo, int64_t pts_us, int duration)
{
if (!vo->config_ok)
@@ -371,6 +358,13 @@ void vo_flip_page(struct vo *vo, int64_t pts_us, int duration)
vo->driver->flip_page(vo);
}
+void vo_redraw(struct vo *vo)
+{
+ vo->want_redraw = false;
+ if (vo->config_ok && vo_control(vo, VOCTRL_REDRAW_FRAME, NULL) == true)
+ vo_flip_page(vo, 0, -1);
+}
+
void vo_check_events(struct vo *vo)
{
vo_control(vo, VOCTRL_CHECK_EVENTS, NULL);