mirror of
https://github.com/mpv-player/mpv
synced 2025-03-07 14:47:53 +00:00
av_log: skip prefix if unknown
This happens with av_log(NULL, ...) calls. Drop the "?: " fallback prefix, because it was confusing. (Of course FFmpeg should not do this at all, but it's a very long way to making the FFmpeg log callback sane.)
This commit is contained in:
parent
4e1159c3f2
commit
34fce974c6
@ -134,8 +134,9 @@ static void mp_msg_av_log_callback(void *ptr, int level, const char *fmt,
|
||||
struct mp_log *log = get_av_log(ptr);
|
||||
|
||||
if (mp_msg_test(log, mp_level)) {
|
||||
if (log_print_prefix)
|
||||
mp_msg(log, mp_level, "%s: ", avc ? avc->item_name(ptr) : "?");
|
||||
const char *prefix = avc ? avc->item_name(ptr) : NULL;
|
||||
if (log_print_prefix && prefix)
|
||||
mp_msg(log, mp_level, "%s: ", prefix);
|
||||
log_print_prefix = fmt[strlen(fmt) - 1] == '\n';
|
||||
|
||||
mp_msg_va(log, mp_level, fmt, vl);
|
||||
|
Loading…
Reference in New Issue
Block a user