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 <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2026-01-07 17:41:03 +01:00
parent 731d5fb9d8
commit f55eece85c

View file

@ -34,6 +34,8 @@
#include <stdarg.h>
#include <string.h>
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;