mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 20:27:23 +00:00
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).
This commit is contained in:
parent
bf3b3d138d
commit
69c13af381
12
sub/ass_mp.c
12
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
|
||||
|
Loading…
Reference in New Issue
Block a user