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.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 9402bc9c82..753feaefeb 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -119,9 +119,16 @@ static int vo_preinit(struct vo *vo, char *arg)
char n[50];
int l = snprintf(n, sizeof(n), "vo/%s", vo->driver->info->short_name);
assert(l < sizeof(n));
+ if (vo->driver->init_option_string) {
+ m_config_parse_suboptions(cfg, n,
+ (char *)vo->driver->init_option_string);
+ }
int r = m_config_parse_suboptions(cfg, n, arg);
- if (r < 0)
+ if (r < 0) {
+ if (vo->driver->help_text)
+ mp_msg(MSGT_VO, MSGL_FATAL, "%s\n", vo->driver->help_text);
return r;
+ }
}
return vo->driver->preinit(vo, arg);
}
@@ -131,21 +138,18 @@ int vo_control(struct vo *vo, uint32_t request, void *data)
return vo->driver->control(vo, request, data);
}
-// Return -1 if driver appears not to support a draw_image interface,
-// 0 otherwise (whether the driver actually drew something or not).
-int vo_draw_image(struct vo *vo, struct mp_image *mpi)
+void vo_queue_image(struct vo *vo, struct mp_image *mpi)
{
if (!vo->config_ok)
- return 0;
+ return;
if (vo->driver->buffer_frames) {
vo->driver->draw_image(vo, mpi);
- return 0;
+ return;
}
vo->frame_loaded = true;
vo->next_pts = mpi->pts;
assert(!vo->waiting_mpi);
vo->waiting_mpi = mp_image_new_ref(mpi);
- return 0;
}
int vo_redraw_frame(struct vo *vo)
@@ -308,6 +312,7 @@ struct vo *init_best_video_out(struct mp_vo_opts *opts,
.input_ctx = input_ctx,
.event_fd = -1,
.registered_fd = -1,
+ .aspdat = { .monitor_par = 1 },
};
// first try the preferred drivers, with their optional subdevice param:
if (vo_list && vo_list[0])
@@ -391,8 +396,7 @@ static void determine_window_geometry(struct vo *vo, int d_w, int d_h)
int scr_w = opts->screenwidth;
int scr_h = opts->screenheight;
- // This is only for applying monitor pixel aspect
- aspect(vo, &d_w, &d_h, A_NOZOOM);
+ aspect_calc_monitor(vo, &d_w, &d_h);
apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->autofit, true);
apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->autofit_larger, false);
@@ -419,7 +423,6 @@ int vo_config(struct vo *vo, uint32_t width, uint32_t height,
uint32_t d_width, uint32_t d_height, uint32_t flags,
uint32_t format)
{
- panscan_init(vo);
aspect_save_videores(vo, width, height, d_width, d_height);
if (vo_control(vo, VOCTRL_UPDATE_SCREENINFO, NULL) == VO_TRUE) {
@@ -514,15 +517,12 @@ void vo_get_src_dst_rects(struct vo *vo, struct mp_rect *out_src,
struct mp_osd_res osd = {
.w = vo->dwidth,
.h = vo->dheight,
- .display_par = vo->monitor_par,
+ .display_par = vo->aspdat.monitor_par,
.video_par = vo->aspdat.par,
};
- if (aspect_scaling(vo)) {
- int scaled_width = 0, scaled_height = 0;
- aspect(vo, &scaled_width, &scaled_height, A_WINZOOM);
- panscan_calc_windowed(vo);
- scaled_width += vo->panscan_x;
- scaled_height += vo->panscan_y;
+ if (vo->opts->keepaspect) {
+ int scaled_width, scaled_height;
+ aspect_calc_panscan(vo, &scaled_width, &scaled_height);
int border_w = vo->dwidth - scaled_width;
int border_h = vo->dheight - scaled_height;
osd.ml = border_w / 2;