summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2021-08-16 10:58:46 +0300
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2021-08-16 11:06:43 +0300
commit36de2efebd40e22bf506e2ec338191d9c34a7975 (patch)
treef2ccbfec5bb031fb1fac03634bd6a606b569cb64
parentcbbd81bb4fd01cc997173ff566ff60ff7587fd1b (diff)
downloadmpv-36de2efebd40e22bf506e2ec338191d9c34a7975.tar.bz2
mpv-36de2efebd40e22bf506e2ec338191d9c34a7975.tar.xz
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.
-rw-r--r--video/out/vo_tct.c6
1 files 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
}