diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2020-04-23 19:41:44 +0300 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2020-04-23 23:25:41 +0300 |
commit | b036e56e67a79ea45b5faf4baf38ca2ff2129416 (patch) | |
tree | 50e087bb279d95c689d1d3276ecf7f5d1e5fa105 /video/out | |
parent | b5b266c38ce8a3ecf0dbbc24f9b9810771b5dba9 (diff) | |
download | mpv-b036e56e67a79ea45b5faf4baf38ca2ff2129416.tar.bz2 mpv-b036e56e67a79ea45b5faf4baf38ca2ff2129416.tar.xz |
video/out/vo_tct: query terminal size generically
terminal_get_size also works on windows. This is useful because now
tct also works on Windows with native VT console.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo_tct.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/video/out/vo_tct.c b/video/out/vo_tct.c index ddd27d0380..b0965e14cc 100644 --- a/video/out/vo_tct.c +++ b/video/out/vo_tct.c @@ -27,6 +27,7 @@ #include "options/m_config.h" #include "config.h" +#include "osdep/terminal.h" #include "vo.h" #include "sub/osd.h" #include "video/sws_utils.h" @@ -179,13 +180,8 @@ static void get_win_size(struct vo *vo, int *out_width, int *out_height) { struct priv *p = vo->priv; *out_width = DEFAULT_WIDTH; *out_height = DEFAULT_HEIGHT; -#if HAVE_POSIX - struct winsize winsize; - if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &winsize) >= 0) { - *out_width = winsize.ws_col; - *out_height = winsize.ws_row; - } -#endif + + terminal_get_size(out_width, out_height); if (p->opts->width > 0) *out_width = p->opts->width; |