diff options
author | wm4 <wm4@nowhere> | 2019-12-16 21:31:54 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-12-16 21:31:54 +0100 |
commit | 5d9aa72f25a1193f6406d8ecda92c8a2142923ef (patch) | |
tree | b72d6975e16e065a7b27ea4250820c94c4270376 /mpv_talloc.h | |
parent | d07b7f068db56aa5fa7cf16b9d077721ff0a8452 (diff) | |
download | mpv-5d9aa72f25a1193f6406d8ecda92c8a2142923ef.tar.bz2 mpv-5d9aa72f25a1193f6406d8ecda92c8a2142923ef.tar.xz |
msg: fix "terminal-default" logging mode
console.lua uses "terminal-default" logging, which is supposed to return
all messages logged to the terminal to the API. Internally, this is
translated to MP_LOG_BUFFER_MSGL_TERM, which is MSGL_MAX+1, because it's
not an actual log level (blame C for not having proper sum types or
something).
Unfortunately, this unintentionally raised the internal log level to
MSGL_MAX+1. It still functioned as intended, because log messages were
simply filtered at a "later" point. But it led to every message being
formatted even if not needed. More importantly, it made mp_msg_test()
pointless (code calls this to avoid logging in "expensive" cases and if
the messages would just get discarded). Also, this broke libplacebo
logging, because the code to map the log messages did not expect a level
higher than MSGL_MAX (mp_msg_level() returned MSGL_MAX+1 too).
Fix this by not letting the dummy level value be used as log level.
Messages at terminal log level will always make it to the inner log
message dispatcher function (i.e. mp_msg_va() will call
write_msg_to_buffers()), so log buffers which use the dummy log level
don't need to adjust the actual log level at all.
Diffstat (limited to 'mpv_talloc.h')
0 files changed, 0 insertions, 0 deletions