From 69c13af3812c0b5da289493ff2a348326cf97b30 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 29 Jul 2012 23:57:46 +0200 Subject: [PATCH] ass_mp.c: remap libass log levels libass is way too chatty. The application using it shouldn't be forced to print useless messages, especially not if the action was initiated by the application, and libass successfully completes it. Note that this might be a problem that should be fixed in libass, but remapping the log levels is needed anyway (instead of relying on the coincidence that the log level values are similar). --- sub/ass_mp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sub/ass_mp.c b/sub/ass_mp.c index 1510e43ab5..bffc42d7cf 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -267,8 +267,20 @@ void mp_ass_configure_fonts(ASS_Renderer *priv) free(family); } +static int map_ass_level[] = { + MSGL_ERR, // 0 "FATAL errors" + MSGL_WARN, + MSGL_INFO, + MSGL_V, + MSGL_V, + MSGL_V, // 5 application recommended level + MSGL_DBG2, + MSGL_DBG3, // 7 "verbose DEBUG" +}; + static void message_callback(int level, const char *format, va_list va, void *ctx) { + level = map_ass_level[level]; mp_msg(MSGT_ASS, level, "[ass] "); mp_msg_va(MSGT_ASS, level, format, va); // libass messages lack trailing \n