summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-04-29 07:16:09 +0200
committerwm4 <wm4@mplayer2.org>2012-04-29 10:01:28 +0200
commit97ac824124fc5cdfbd9ac74156b79c098bce09c6 (patch)
tree2c924403e2fb619ec57ee0933cd12d32ef1bb62a /input
parent87f4cafe9c0881743d1117c2e8cd7e3376e33302 (diff)
parentf64a4e9931428de0f308f6ed0a0144edb8ce9619 (diff)
downloadmpv-97ac824124fc5cdfbd9ac74156b79c098bce09c6.tar.bz2
mpv-97ac824124fc5cdfbd9ac74156b79c098bce09c6.tar.xz
Merge remote-tracking branch 'origin/master'
Conflicts: bstr.c bstr.h libvo/cocoa_common.m libvo/gl_common.c libvo/video_out.c mplayer.c screenshot.c sub/subassconvert.c Merge of cocoa_common.m done by pigoz. Picking my version of screenshot.c. The fix in commit aadf1002f8a will be redone in a follow-up commit, as the original commit causes too many conflicts with the work done locally in this branch, and other work in progress.
Diffstat (limited to 'input')
-rw-r--r--input/input.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/input/input.c b/input/input.c
index 57b2d21f9d..ffa69043f8 100644
--- a/input/input.c
+++ b/input/input.c
@@ -59,6 +59,10 @@
#include "ar.h"
+#ifdef CONFIG_COCOA
+#include "osdep/cocoa_events.h"
+#endif
+
#define MP_MAX_KEY_DOWN 32
struct cmd_bind {
@@ -1454,7 +1458,7 @@ static void read_events(struct input_ctx *ictx, int time)
* every source until it's known to be empty. Instead we use this wrapper
* to run select() again.
*/
-static void read_all_events(struct input_ctx *ictx, int time)
+static void read_all_fd_events(struct input_ctx *ictx, int time)
{
while (1) {
read_events(ictx, time);
@@ -1464,6 +1468,15 @@ static void read_all_events(struct input_ctx *ictx, int time)
}
}
+static void read_all_events(struct input_ctx *ictx, int time)
+{
+#ifdef CONFIG_COCOA
+ cocoa_events_read_all_events(ictx, time);
+#else
+ read_all_fd_events(ictx, time);
+#endif
+}
+
int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd)
{
ictx->got_new_events = true;
@@ -1761,6 +1774,10 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf)
.wakeup_pipe = {-1, -1},
};
+#ifdef CONFIG_COCOA
+ cocoa_events_init(ictx, read_all_fd_events);
+#endif
+
#ifndef __MINGW32__
long ret = pipe(ictx->wakeup_pipe);
for (int i = 0; i < 2 && ret >= 0; i++) {
@@ -1866,11 +1883,16 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf)
mp_tmsg(MSGT_INPUT, MSGL_ERR, "Can't open %s: %s\n",
input_conf->in_file, strerror(errno));
}
+
return ictx;
}
void mp_input_uninit(struct input_ctx *ictx)
{
+#ifdef CONFIG_COCOA
+ cocoa_events_uninit();
+#endif
+
if (!ictx)
return;