From f55eece85c367558cc770538b1e2414ebc615e38 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 7 Jan 2026 17:41:03 +0100 Subject: [PATCH] error: return old snd_lib_error_set_handler() behaviour Unfortunately, the case when the old application sets own error callback using the old method, was not handled properly in snd_lib_vlog_default() function. Make sure that only error messages are passed to this old callback and silent other log priorities. Link: https://bugs.gentoo.org/968131 Signed-off-by: Jaroslav Kysela --- src/error.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/error.c b/src/error.c index e575f2eb..1cb8a579 100644 --- a/src/error.c +++ b/src/error.c @@ -34,6 +34,8 @@ #include #include +static void snd_lib_error_default(const char *file, int line, const char *function, int errcode, const char *fmt, ...); + /** * Array of error codes in US ASCII. */ @@ -317,6 +319,12 @@ static void snd_lib_vlog_default(int prio, int interface, const char *file, int local_error(file, line, function, errcode, fmt, arg); return; } + if (snd_lib_error != snd_lib_error_default) { + if (prio == SND_LOG_ERROR) + snd_lib_error(file, line, function, errcode, fmt, arg); + /* ignore other priorities - restore old behaviour */ + return; + } if (!snd_lib_log_filter(prio, interface, NULL)) return; -- 2.47.3