mirror of https://github.com/mpv-player/mpv
vo_tct: check ioctl result
This commit is contained in:
parent
8c701587c8
commit
326920a9bf
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue