summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
Diffstat (limited to 'osdep')
-rw-r--r--osdep/terminal-unix.c4
-rw-r--r--osdep/terminal-win.c3
2 files changed, 3 insertions, 4 deletions
diff --git a/osdep/terminal-unix.c b/osdep/terminal-unix.c
index 64d6df3f37..9b4e5709cc 100644
--- a/osdep/terminal-unix.c
+++ b/osdep/terminal-unix.c
@@ -410,11 +410,9 @@ static void *terminal_thread(void *ptr)
void terminal_setup_getch(struct input_ctx *ictx)
{
- if (!getch2_enabled)
+ if (!getch2_enabled || input_ctx)
return;
- assert(!input_ctx); // already setup
-
if (mp_make_wakeup_pipe(death_pipe) < 0)
return;
diff --git a/osdep/terminal-win.c b/osdep/terminal-win.c
index cda9e69040..c04a13a639 100644
--- a/osdep/terminal-win.c
+++ b/osdep/terminal-win.c
@@ -136,7 +136,8 @@ static void *input_thread_fn(void *ptr)
void terminal_setup_getch(struct input_ctx *ictx)
{
- assert(!running);
+ if (running)
+ return;
HANDLE in = GetStdHandle(STD_INPUT_HANDLE);
if (GetNumberOfConsoleInputEvents(in, &(DWORD){0})) {