0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.
This commit is contained in:
wm4 2014-04-21 22:53:51 +02:00
parent ba1380223a
commit 259fb392a5

View File

@ -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;
}