summaryrefslogtreecommitdiffstats
path: root/libvo/video_out.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-12-20 11:52:11 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-12-20 11:52:11 +0000
commitd1065dffe100a0bc08868bb630db11dc032c62f4 (patch)
tree6c2a3dc2f6dbedbf6830e66c23b6c31c2adfbdcf /libvo/video_out.c
parent4f3d487e06207bc63644d59d86ad9c04ef7d96bb (diff)
downloadmpv-d1065dffe100a0bc08868bb630db11dc032c62f4.tar.bz2
mpv-d1065dffe100a0bc08868bb630db11dc032c62f4.tar.xz
Add and use a special lookup function to do table-based translation to MPlayer keycodes.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28172 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/video_out.c')
-rw-r--r--libvo/video_out.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c
index 70a17f218d..c65f3a5710 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -328,6 +328,17 @@ int config_video_out(const vo_functions_t *vo, uint32_t width, uint32_t height,
return vo->config(width, height, d_width, d_height, flags, title, format);
}
+/**
+ * \brief lookup an integer in a table, table must have 0 as the last key
+ * \param key key to search for
+ * \result translation corresponding to key or "to" value of last mapping
+ * if not found.
+ */
+int lookup_keymap_table(const struct keymap *map, int key) {
+ while (map->from && map->from != key) map++;
+ return map->to;
+}
+
#if defined(CONFIG_FBDEV) || defined(CONFIG_VESA)
/* Borrowed from vo_fbdev.c
Monitor ranges related functions*/