diff options
author | rslovers <rslovers@yandex.com> | 2017-06-07 13:58:12 +0000 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-06-08 15:24:10 +0200 |
commit | 9821737d0611d3e1a4a3ede40bd796f49a6e3445 (patch) | |
tree | 44db1ac85549d39882fe7f66192ca8bf889bba6e /video | |
parent | bd603c2997a3e8a292b4a9733fcfe0cd8abaff5c (diff) | |
download | mpv-9821737d0611d3e1a4a3ede40bd796f49a6e3445.tar.bz2 mpv-9821737d0611d3e1a4a3ede40bd796f49a6e3445.tar.xz |
vo_drm: fallback to vo_wait_default if VT switcher is not available
When the drm video output is used under VT with a terminal multiplexer
like screen, the VT_SETMODE ioctl call will fail since the controlling
terminal is a pseudoterminal instead of a real one, thus the VT switcher
will be unavailable.
The problem is, the wait_events function inside vo_drm.c will test for
this, and will do nothing if the switcher is not active. Normally, this
would not be noticed, however, when you pause a video, or if you're playing
multiple image files, mpv will suddenly start busy waiting on a single
core.
I confirmed this by building mpv with gprof support, in a few seconds,
wait_events got called about 90 million times.
So I added a fallback, when the VT switcher is not availble, just use the
vo_wait_default function. I tested it and it's working well so far.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo_drm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c index 3436e0fc5c..2fdd840588 100644 --- a/video/out/vo_drm.c +++ b/video/out/vo_drm.c @@ -250,6 +250,8 @@ static void wait_events(struct vo *vo, int64_t until_time_us) int64_t wait_us = until_time_us - mp_time_us(); int timeout_ms = MPCLAMP((wait_us + 500) / 1000, 0, 10000); vt_switcher_poll(&p->vt_switcher, timeout_ms); + } else { + vo_wait_default(vo, until_time_us); } } |