summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/msg.c2
-rw-r--r--input/input.c11
-rwxr-xr-xold-configure4
-rw-r--r--osdep/terminal-unix.c (renamed from osdep/getch2.c)2
-rw-r--r--osdep/terminal-win.c (renamed from osdep/getch2-win.c)2
-rw-r--r--osdep/terminal.h (renamed from osdep/getch2.h)0
-rw-r--r--player/loadfile.c2
-rw-r--r--player/main.c2
-rw-r--r--player/osd.c2
-rw-r--r--player/playloop.c4
-rw-r--r--wscript_build.py4
11 files changed, 16 insertions, 19 deletions
diff --git a/common/msg.c b/common/msg.c
index dd03be0f73..3dd36dfbb6 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -27,7 +27,7 @@
#include "config.h"
#include "common/global.h"
-#include "osdep/getch2.h"
+#include "osdep/terminal.h"
#include "osdep/io.h"
#ifndef __MINGW32__
diff --git a/input/input.c b/input/input.c
index 9868ac1423..6ae14f892d 100644
--- a/input/input.c
+++ b/input/input.c
@@ -36,7 +36,6 @@
#include <libavutil/common.h>
#include "osdep/io.h"
-#include "osdep/getch2.h"
#include "input.h"
#include "keycodes.h"
@@ -1859,12 +1858,6 @@ static void read_events(struct input_ctx *ictx, int time)
}
}
-static void read_all_events(struct input_ctx *ictx, int time)
-{
- getch2_poll();
- read_events(ictx, time);
-}
-
int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd)
{
input_lock(ictx);
@@ -1919,7 +1912,7 @@ mp_cmd_t *mp_input_get_cmd(struct input_ctx *ictx, int time, int peek_only)
if (ictx->cmd_queue.first)
time = 0;
- read_all_events(ictx, time);
+ read_events(ictx, time);
struct cmd_queue *queue = &ictx->cmd_queue;
if (!queue->first) {
struct mp_cmd *repeated = check_autorepeat(ictx);
@@ -2529,7 +2522,7 @@ int mp_input_check_interrupt(struct input_ctx *ictx, int time)
input_lock(ictx);
bool res = test_abort(ictx);
if (!res) {
- read_all_events(ictx, time);
+ read_events(ictx, time);
res = test_abort(ictx);
}
input_unlock(ictx);
diff --git a/old-configure b/old-configure
index e323c93a6a..f4baba7ee1 100755
--- a/old-configure
+++ b/old-configure
@@ -876,7 +876,7 @@ fi
extra_cflags="-I. -D_GNU_SOURCE $extra_cflags"
_timer=timer-linux.c
-_getch=getch2.c
+_getch=terminal-unix.c
if freebsd || openbsd ; then
extra_ldflags="$extra_ldflags -L/usr/local/lib"
@@ -908,7 +908,7 @@ if win32 ; then
fi
if mingw32 ; then
- _getch=getch2-win.c
+ _getch=terminal-win.c
extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
# Hack for missing BYTE_ORDER declarations in <sys/types.h>.
# (For some reason, they are in <sys/param.h>, but we don't bother switching
diff --git a/osdep/getch2.c b/osdep/terminal-unix.c
index 054b9bf63f..583ab162eb 100644
--- a/osdep/getch2.c
+++ b/osdep/terminal-unix.c
@@ -45,7 +45,7 @@
#include "bstr/bstr.h"
#include "input/input.h"
#include "input/keycodes.h"
-#include "getch2.h"
+#include "terminal.h"
#if HAVE_TERMIOS
static volatile struct termios tio_orig;
diff --git a/osdep/getch2-win.c b/osdep/terminal-win.c
index 166084d425..a56d1a409c 100644
--- a/osdep/getch2-win.c
+++ b/osdep/terminal-win.c
@@ -30,7 +30,7 @@
#include <windows.h>
#include "input/keycodes.h"
#include "input/input.h"
-#include "getch2.h"
+#include "terminal.h"
int mp_input_slave_cmd_func(int fd, char *dest, int size)
{
diff --git a/osdep/getch2.h b/osdep/terminal.h
index 76cedd9928..76cedd9928 100644
--- a/osdep/getch2.h
+++ b/osdep/terminal.h
diff --git a/player/loadfile.c b/player/loadfile.c
index 12a8568973..d9518c1918 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -26,8 +26,8 @@
#include "config.h"
#include "talloc.h"
-#include "osdep/getch2.h"
#include "osdep/io.h"
+#include "osdep/terminal.h"
#include "osdep/timer.h"
#include "common/msg.h"
diff --git a/player/main.c b/player/main.c
index 217d01c00f..a1d56df5f0 100644
--- a/player/main.c
+++ b/player/main.c
@@ -28,8 +28,8 @@
#include "talloc.h"
#include "osdep/io.h"
-#include "osdep/getch2.h"
#include "osdep/priority.h"
+#include "osdep/terminal.h"
#include "osdep/timer.h"
#include "common/av_log.h"
diff --git a/player/osd.c b/player/osd.c
index c87585c42d..f475757bdc 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -32,7 +32,7 @@
#include "options/m_property.h"
#include "common/encode.h"
-#include "osdep/getch2.h"
+#include "osdep/terminal.h"
#include "osdep/timer.h"
#include "demux/demux.h"
diff --git a/player/playloop.c b/player/playloop.c
index a018088cfc..971895b6a2 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -33,6 +33,7 @@
#include "common/playlist.h"
#include "input/input.h"
+#include "osdep/terminal.h"
#include "osdep/timer.h"
#include "audio/mixer.h"
@@ -1310,6 +1311,8 @@ void run_playloop(struct MPContext *mpctx)
handle_force_window(mpctx, false);
execute_queued_seek(mpctx);
+
+ getch2_poll();
}
// Waiting for the slave master to send us a new file to play.
@@ -1339,5 +1342,6 @@ void idle_loop(struct MPContext *mpctx)
run_command(mpctx, cmd);
mp_cmd_free(cmd);
mp_flush_events(mpctx);
+ getch2_poll();
}
}
diff --git a/wscript_build.py b/wscript_build.py
index d2495d3b68..2d36ea9b2d 100644
--- a/wscript_build.py
+++ b/wscript_build.py
@@ -91,8 +91,8 @@ def build(ctx):
target = "ebml_defs.c")
getch2_c = {
- 'win32': 'osdep/getch2-win.c',
- }.get(ctx.env.DEST_OS, "osdep/getch2.c")
+ 'win32': 'osdep/terminal-win.c',
+ }.get(ctx.env.DEST_OS, "osdep/terminal-unix.c")
timer_c = {
'win32': 'osdep/timer-win2.c',