summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-04-21 22:53:51 +0200
committerwm4 <wm4@nowhere>2014-04-22 01:42:54 +0200
commit259fb392a52ec89ad3b0168e4c775e1e0a7cd9b9 (patch)
tree4451a8aa60899735a8dc35f3653a674401ddfad6 /video
parentba1380223a8d77a0cb62523d52bd855c5dc621b6 (diff)
downloadmpv-259fb392a52ec89ad3b0168e4c775e1e0a7cd9b9.tar.bz2
mpv-259fb392a52ec89ad3b0168e4c775e1e0a7cd9b9.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c16
1 files changed, 15 insertions, 1 deletions
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;
}