summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-07-29 23:57:46 +0200
committerwm4 <wm4@nowhere>2012-07-30 01:49:35 +0200
commit69c13af3812c0b5da289493ff2a348326cf97b30 (patch)
tree71959a8470ad07af669c738c8b5330ab1d608095 /sub
parentbf3b3d138d94dfb40364197920e5925762bd1615 (diff)
downloadmpv-69c13af3812c0b5da289493ff2a348326cf97b30.tar.bz2
mpv-69c13af3812c0b5da289493ff2a348326cf97b30.tar.xz
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).
Diffstat (limited to 'sub')
-rw-r--r--sub/ass_mp.c12
1 files changed, 12 insertions, 0 deletions
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