From 36de2efebd40e22bf506e2ec338191d9c34a7975 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Mon, 16 Aug 2021 10:58:46 +0300 Subject: vo_tct: fix --vo-tct-256 This is a regression from cbbd81bb (the previous commit): print_seq1 (which prints a sequence with 1 parametric byte value) is used with 256 colors output, and apparently was never tested. Two issues were introduced at the offending commit: 1. The ";5" part was incorrectly removed from the strings ESC_COLOR256_{BG,FG} (affects both *nix and Windows). 2. On windows only - a semicolon was not used after the prefix. Both issues resulted in an invalid 256 colors sequences and output. --- video/out/vo_tct.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/video/out/vo_tct.c b/video/out/vo_tct.c index c302aa3c1e..ec30958ddd 100644 --- a/video/out/vo_tct.c +++ b/video/out/vo_tct.c @@ -45,8 +45,8 @@ #define ESC_GOTOXY "\033[%d;%df" #define ESC_COLOR_BG "\033[48;2" #define ESC_COLOR_FG "\033[38;2" -#define ESC_COLOR256_BG "\033[48" -#define ESC_COLOR256_FG "\033[38" +#define ESC_COLOR256_BG "\033[48;5" +#define ESC_COLOR256_FG "\033[38;5" #define DEFAULT_WIDTH 80 #define DEFAULT_HEIGHT 25 @@ -145,7 +145,7 @@ static void print_seq1(struct lut_item *lut, const char* prefix, uint8_t c) fwrite(lut[c].str, lut[c].width, 1, stdout); fputc('m', stdout); #else - printf("%s%dm", prefix, (int)c); + printf("%s;%dm", prefix, (int)c); #endif } -- cgit v1.2.3