diff options
Diffstat (limited to 'video/out/vo_tct.c')
-rw-r--r-- | video/out/vo_tct.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/video/out/vo_tct.c b/video/out/vo_tct.c index 68b29e9bc8..dbe5d69fb6 100644 --- a/video/out/vo_tct.c +++ b/video/out/vo_tct.c @@ -177,14 +177,14 @@ static void write_half_blocks( static void get_win_size(struct vo *vo, int *out_width, int *out_height) { struct priv *p = vo->priv; -#if HAVE_POSIX - struct winsize winsize; - ioctl(STDOUT_FILENO, TIOCGWINSZ, &winsize); - *out_width = winsize.ws_col; - *out_height = winsize.ws_row; -#else *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 if (p->opts->width > 0) |