mirror of https://github.com/mpv-player/mpv
vo_sixel: Add fallback terminal width and height
In case terminal_get_size function fails, the default height of 25 rows and 80 columns will be assumed
This commit is contained in:
parent
baf45b3bc9
commit
fd48f0bcb2
|
@ -38,6 +38,9 @@
|
|||
|
||||
#define IMGFMT IMGFMT_RGB24
|
||||
|
||||
#define TERMINAL_FALLBACK_DEFAULT_WIDTH 80
|
||||
#define TERMINAL_FALLBACK_DEFAULT_HEIGHT 25
|
||||
|
||||
#define ESC_HIDE_CURSOR "\033[?25l"
|
||||
#define ESC_RESTORE_CURSOR "\033[?25h"
|
||||
#define ESC_CLEAR_SCREEN "\033[2J"
|
||||
|
@ -82,8 +85,8 @@ static void validate_offset_values(struct vo* vo)
|
|||
struct priv* priv = vo->priv;
|
||||
int top = priv->top;
|
||||
int left = priv->left;
|
||||
int terminal_width = 0;
|
||||
int terminal_height = 0;
|
||||
int terminal_width = TERMINAL_FALLBACK_DEFAULT_WIDTH;
|
||||
int terminal_height = TERMINAL_FALLBACK_DEFAULT_HEIGHT;
|
||||
|
||||
terminal_get_size(&terminal_width, &terminal_height);
|
||||
|
||||
|
|
Loading…
Reference in New Issue