summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-28 11:53:57 +0200
committerKevin Mitchell <kevmitch@gmail.com>2017-12-15 22:28:47 -0800
commitba1943ac00ed20a568270f8930811c1eac08f66a (patch)
treed3cd2e11c7bbb2d6e8c6f4eea08daa9d0d91107c /input
parentd744dca5379c0876cb5adef7ffa41c1bc95e8158 (diff)
downloadmpv-ba1943ac00ed20a568270f8930811c1eac08f66a.tar.bz2
mpv-ba1943ac00ed20a568270f8930811c1eac08f66a.tar.xz
msg: reinterpret a bunch of message levels
I've decided that MP_TRACE means “noisy spam per frame”, whereas MP_DBG just means “more verbose debugging messages than MSGL_V”. Basically, MSGL_DBG shouldn't create spam per frame like it currently does, and MSGL_V should make sense to the end-user and provide mostly additional informational output. MP_DBG is basically what I want to make the new default for --log-file, so the cut-off point for MP_DBG is if we probably want to know if for debugging purposes but the user most likely doesn't care about on the terminal. Also, the debug callbacks for libass and ffmpeg got bumped in their verbosity levels slightly, because being external components they're a bit less relevant to mpv debugging, and a bit too over-eager in what they consider to be relevant information. I exclusively used the "try it on my machine and remove messages from MSGL_* until it does what I want it to" approach of refactoring, so YMMV.
Diffstat (limited to 'input')
-rw-r--r--input/input.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/input/input.c b/input/input.c
index b3f3d8d93e..14a4defa09 100644
--- a/input/input.c
+++ b/input/input.c
@@ -468,7 +468,7 @@ static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, char *force_section,
return mp_input_parse_cmd_strv(ictx->log, (const char*[]){"quit", 0});
int msgl = MSGL_WARN;
if (MP_KEY_IS_MOUSE_MOVE(code))
- msgl = MSGL_DEBUG;
+ msgl = MSGL_TRACE;
char *key_buf = mp_input_get_key_combo_name(&code, 1);
MP_MSG(ictx, msgl, "No key binding found for key '%s'.\n", key_buf);
talloc_free(key_buf);
@@ -478,8 +478,8 @@ static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, char *force_section,
if (ret) {
ret->input_section = cmd->owner->section;
ret->key_name = talloc_steal(ret, mp_input_get_key_combo_name(&code, 1));
- MP_DBG(ictx, "key '%s' -> '%s' in '%s'\n",
- ret->key_name, cmd->cmd, ret->input_section);
+ MP_TRACE(ictx, "key '%s' -> '%s' in '%s'\n",
+ ret->key_name, cmd->cmd, ret->input_section);
ret->is_mouse_button = code & MP_KEY_EMIT_ON_UP;
} else {
char *key_buf = mp_input_get_key_combo_name(&code, 1);
@@ -501,8 +501,8 @@ static void update_mouse_section(struct input_ctx *ictx)
ictx->mouse_section = new_section;
if (strcmp(old, ictx->mouse_section) != 0) {
- MP_DBG(ictx, "input: switch section %s -> %s\n",
- old, ictx->mouse_section);
+ MP_TRACE(ictx, "input: switch section %s -> %s\n",
+ old, ictx->mouse_section);
mp_input_queue_cmd(ictx, get_cmd_from_keys(ictx, old, MP_KEY_MOUSE_LEAVE));
}
}
@@ -561,9 +561,9 @@ static void interpret_key(struct input_ctx *ictx, int code, double scale,
if (mp_msg_test(ictx->log, MSGL_DEBUG)) {
char *key = mp_input_get_key_name(code);
- MP_DBG(ictx, "key code=%#x '%s'%s%s\n",
- code, key, (state & MP_KEY_STATE_DOWN) ? " down" : "",
- (state & MP_KEY_STATE_UP) ? " up" : "");
+ MP_TRACE(ictx, "key code=%#x '%s'%s%s\n",
+ code, key, (state & MP_KEY_STATE_DOWN) ? " down" : "",
+ (state & MP_KEY_STATE_UP) ? " up" : "");
talloc_free(key);
}
@@ -708,7 +708,7 @@ static void mp_input_feed_key(struct input_ctx *ictx, int code, double scale,
code = mp_normalize_keycode(code);
int unmod = code & ~MP_KEY_MODIFIER_MASK;
if (code == MP_INPUT_RELEASE_ALL) {
- MP_DBG(ictx, "release all\n");
+ MP_TRACE(ictx, "release all\n");
release_down_cmd(ictx, false);
return;
}
@@ -816,7 +816,7 @@ void mp_input_set_mouse_pos(struct input_ctx *ictx, int x, int y)
void mp_input_set_mouse_pos_artificial(struct input_ctx *ictx, int x, int y)
{
input_lock(ictx);
- MP_DBG(ictx, "mouse move %d/%d\n", x, y);
+ MP_TRACE(ictx, "mouse move %d/%d\n", x, y);
if (ictx->mouse_vo_x == x && ictx->mouse_vo_y == y) {
input_unlock(ictx);
@@ -832,7 +832,7 @@ void mp_input_set_mouse_pos_artificial(struct input_ctx *ictx, int x, int y)
x = x * 1.0 / (dst->x1 - dst->x0) * (src->x1 - src->x0) + src->x0;
y = y * 1.0 / (dst->y1 - dst->y0) * (src->y1 - src->y0) + src->y0;
}
- MP_DBG(ictx, "-> %d/%d\n", x, y);
+ MP_TRACE(ictx, "-> %d/%d\n", x, y);
}
ictx->mouse_event_counter++;