summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2024-03-16 23:36:46 +0100
committerKacper Michajłow <kasper93@gmail.com>2024-03-19 19:58:09 +0100
commit8ee25db71f0a47b09aedd5a24f9729a3f3ac6de3 (patch)
tree433f02b264c49a4634c6b4bf4fad8f08ac75a8ba /test
parent7bdd673a72859a110243af46951619944d3b2e05 (diff)
downloadmpv-8ee25db71f0a47b09aedd5a24f9729a3f3ac6de3.tar.bz2
mpv-8ee25db71f0a47b09aedd5a24f9729a3f3ac6de3.tar.xz
win32: cache GetConsoleMode state for stdout/stderr
GetConsoleMode() can be quite slow and in mpv the mode never changes, so we can just check it once. Fixes performance when writing lots of logs to terminal.
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.c4
-rw-r--r--test/test_utils.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/test/test_utils.c b/test/test_utils.c
index 98597c9847..7e5f2e6ce7 100644
--- a/test/test_utils.c
+++ b/test/test_utils.c
@@ -4,6 +4,7 @@
#include "options/m_option.h"
#include "options/path.h"
#include "osdep/subprocess.h"
+#include "osdep/terminal.h"
#include "test_utils.h"
#ifdef NDEBUG
@@ -106,7 +107,8 @@ void mp_msg(struct mp_log *log, int lev, const char *format, ...) {};
int mp_msg_find_level(const char *s) {return 0;};
int mp_msg_level(struct mp_log *log) {return 0;};
void mp_msg_set_max_level(struct mp_log *log, int lev) {};
-void mp_write_console_ansi(void) {};
+void mp_write_console_ansi(void *wstream, char *buf) {};
+bool mp_check_console(void *handle) { return false; };
void mp_set_avdict(AVDictionary **dict, char **kv) {};
struct mp_log *mp_log_new(void *talloc_ctx, struct mp_log *parent,
const char *name) { return NULL; };
diff --git a/test/test_utils.h b/test/test_utils.h
index df8c567ce9..7db358e21a 100644
--- a/test/test_utils.h
+++ b/test/test_utils.h
@@ -52,6 +52,5 @@ void mp_msg(struct mp_log *log, int lev, const char *format, ...)
int mp_msg_find_level(const char *s);
int mp_msg_level(struct mp_log *log);
void mp_msg_set_max_level(struct mp_log *log, int lev);
-void mp_write_console_ansi(void);
typedef struct AVDictionary AVDictionary;
void mp_set_avdict(AVDictionary **dict, char **kv);