From 259fb392a52ec89ad3b0168e4c775e1e0a7cd9b9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 21 Apr 2014 22:53:51 +0200 Subject: vo: warn if the VO doesn't support certain flags Unfortunately, if a VO can't display something as intended, we can just complain to the user, and leave it at it. But it's still better than silently displaying things differently with different VOs. For now, this is used for rotation only. Other things that we should check includes colorspace and colorlevels stuff. --- video/out/vo.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'video') diff --git a/video/out/vo.c b/video/out/vo.c index 9af1d59c6d..122bd02bf5 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -418,6 +418,18 @@ static int event_fd_callback(void *ctx, int fd) return MP_INPUT_NOTHING; } +static void check_vo_caps(struct vo *vo) +{ + int rot = vo->params->rotate; + if (rot) { + bool ok = rot % 90 ? false : (vo->driver->caps & VO_CAP_ROTATE90); + if (!ok) { + MP_WARN(vo, "Video is flagged as rotated by %d degrees, but the " + "video output does not support this.\n", rot); + } + } +} + int vo_reconfig(struct vo *vo, struct mp_image_params *params, int flags) { int d_width = params->d_w; @@ -441,7 +453,9 @@ int vo_reconfig(struct vo *vo, struct mp_image_params *params, int flags) int ret = vo->driver->reconfig(vo, vo->params, flags); vo->config_ok = ret >= 0; vo->config_count += vo->config_ok; - if (!vo->config_ok) { + if (vo->config_ok) { + check_vo_caps(vo); + } else { talloc_free(vo->params); vo->params = NULL; } -- cgit v1.2.3