vo_tct: check ioctl result

This commit is contained in:
rr- 2017-02-20 14:14:35 +01:00 committed by wm4
parent 8c701587c8
commit 326920a9bf
1 changed files with 6 additions and 6 deletions

View File

@ -177,14 +177,14 @@ static void write_half_blocks(
static void get_win_size(struct vo *vo, int *out_width, int *out_height) { static void get_win_size(struct vo *vo, int *out_width, int *out_height) {
struct priv *p = vo->priv; 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_width = DEFAULT_WIDTH;
*out_height = DEFAULT_HEIGHT; *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 #endif
if (p->opts->width > 0) if (p->opts->width > 0)