From b036e56e67a79ea45b5faf4baf38ca2ff2129416 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Thu, 23 Apr 2020 19:41:44 +0300 Subject: 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. --- video/out/vo_tct.c | 10 +++------- 1 file 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; -- cgit v1.2.3