diff options
author | Niklas Haas <git@haasn.xyz> | 2017-09-28 11:53:57 +0200 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2017-12-15 22:28:47 -0800 |
commit | ba1943ac00ed20a568270f8930811c1eac08f66a (patch) | |
tree | d3cd2e11c7bbb2d6e8c6f4eea08daa9d0d91107c /player | |
parent | d744dca5379c0876cb5adef7ffa41c1bc95e8158 (diff) | |
download | mpv-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 'player')
-rw-r--r-- | player/command.c | 2 | ||||
-rw-r--r-- | player/lua.c | 4 | ||||
-rw-r--r-- | player/lua/osc.lua | 14 | ||||
-rw-r--r-- | player/scripting.c | 4 | ||||
-rw-r--r-- | player/video.c | 8 |
5 files changed, 16 insertions, 16 deletions
diff --git a/player/command.c b/player/command.c index 9c0dd31f28..c6ad573ed0 100644 --- a/player/command.c +++ b/player/command.c @@ -4845,7 +4845,7 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re int osdl = msg_osd ? 1 : OSD_LEVEL_INVISIBLE; bool async = cmd->flags & MP_ASYNC_CMD; - mp_cmd_dump(mpctx->log, cmd->id == MP_CMD_IGNORE ? MSGL_DEBUG : MSGL_V, + mp_cmd_dump(mpctx->log, cmd->id == MP_CMD_IGNORE ? MSGL_TRACE : MSGL_DEBUG, "Run command:", cmd); if (cmd->flags & MP_EXPAND_PROPERTIES) { diff --git a/player/lua.c b/player/lua.c index e084624ccf..d928fdfa46 100644 --- a/player/lua.c +++ b/player/lua.c @@ -193,7 +193,7 @@ static void add_functions(struct script_ctx *ctx); static void load_file(lua_State *L, const char *fname) { struct script_ctx *ctx = get_ctx(L); - MP_VERBOSE(ctx, "loading file %s\n", fname); + MP_DBG(ctx, "loading file %s\n", fname); int r = luaL_loadfile(L, fname); if (r) lua_error(L); @@ -222,7 +222,7 @@ static int load_builtin(lua_State *L) static void require(lua_State *L, const char *name) { struct script_ctx *ctx = get_ctx(L); - MP_VERBOSE(ctx, "loading %s\n", name); + MP_DBG(ctx, "loading %s\n", name); // Lazy, but better than calling the "require" function manually char buf[80]; snprintf(buf, sizeof(buf), "require '%s'", name); diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 6bd596ce25..b0e0638730 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -1902,7 +1902,7 @@ function show_osc() -- show when disabled can happen (e.g. mouse_move) due to async/delayed unbinding if not state.enabled then return end - msg.debug("show_osc") + msg.trace("show_osc") --remember last time of invocation (mouse move) state.showtime = mp.get_time() @@ -1914,7 +1914,7 @@ function show_osc() end function hide_osc() - msg.debug("hide_osc") + msg.trace("hide_osc") if not state.enabled then -- typically hide happens at render() from tick(), but now tick() is -- no-op and won't render again to remove the osc, so do that manually. @@ -1958,7 +1958,7 @@ end function timer_start() if not (state.timer_active) then - msg.debug("timer start") + msg.trace("timer start") if (state.timer == nil) then -- create new timer @@ -1974,7 +1974,7 @@ end function timer_stop() if (state.timer_active) then - msg.debug("timer stop") + msg.trace("timer stop") if not (state.timer == nil) then -- kill timer @@ -2000,12 +2000,12 @@ function request_init() end function render_wipe() - msg.debug("render_wipe()") + msg.trace("render_wipe()") mp.set_osd_ass(0, 0, "{}") end function render() - msg.debug("rendering") + msg.trace("rendering") local current_screen_sizeX, current_screen_sizeY, aspect = mp.get_osd_size() local mouseX, mouseY = get_virt_mouse_pos() local now = mp.get_time() @@ -2208,7 +2208,7 @@ function tick() if (state.idle) then -- render idle message - msg.debug("idle message") + msg.trace("idle message") local icon_x, icon_y = 320 - 26, 140 local ass = assdraw.ass_new() diff --git a/player/scripting.c b/player/scripting.c index 28f8fdd038..38e8809020 100644 --- a/player/scripting.c +++ b/player/scripting.c @@ -140,7 +140,7 @@ int mp_load_script(struct MPContext *mpctx, const char *fname) } arg->log = mp_client_get_log(arg->client); - MP_VERBOSE(arg, "Loading %s %s...\n", backend->name, fname); + MP_DBG(arg, "Loading %s %s...\n", backend->name, fname); pthread_t thread; if (pthread_create(&thread, NULL, script_thread, arg)) { @@ -150,7 +150,7 @@ int mp_load_script(struct MPContext *mpctx, const char *fname) } wait_loaded(mpctx); - MP_VERBOSE(mpctx, "Done loading %s.\n", fname); + MP_DBG(mpctx, "Done loading %s.\n", fname); return 0; } diff --git a/player/video.c b/player/video.c index 634eee0f86..ef1423c8a5 100644 --- a/player/video.c +++ b/player/video.c @@ -1072,10 +1072,10 @@ static void handle_display_sync_frame(struct MPContext *mpctx, double prev_error = mpctx->display_sync_error; mpctx->display_sync_error += frame_duration - num_vsyncs * vsync; - MP_DBG(mpctx, "s=%f vsyncs=%d dur=%f ratio=%f err=%.20f (%f/%f)\n", - mpctx->speed_factor_v, num_vsyncs, adjusted_duration, ratio, - mpctx->display_sync_error, mpctx->display_sync_error / vsync, - mpctx->display_sync_error / frame_duration); + MP_TRACE(mpctx, "s=%f vsyncs=%d dur=%f ratio=%f err=%.20f (%f/%f)\n", + mpctx->speed_factor_v, num_vsyncs, adjusted_duration, ratio, + mpctx->display_sync_error, mpctx->display_sync_error / vsync, + mpctx->display_sync_error / frame_duration); MP_STATS(mpctx, "value %f avdiff", av_diff); |