mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
alsa-acp: bind the acp log func to the spa_log object directly
When the acp-device impl struct is passed to the log func, it is possible that when this device is removed, another device using acp is going to crash while logging a message
This commit is contained in:
parent
dd45a27d86
commit
5c749cf7c3
1 changed files with 3 additions and 3 deletions
|
|
@ -827,8 +827,8 @@ static SPA_PRINTF_FUNC(6,0) void impl_acp_log_func(void *data,
|
||||||
int level, const char *file, int line, const char *func,
|
int level, const char *file, int line, const char *func,
|
||||||
const char *fmt, va_list arg)
|
const char *fmt, va_list arg)
|
||||||
{
|
{
|
||||||
struct impl *this = data;
|
struct spa_log *log = data;
|
||||||
spa_log_logv(this->log, (enum spa_log_level)level, file, line, func, fmt, arg);
|
spa_log_logv(log, (enum spa_log_level)level, file, line, func, fmt, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int impl_clear(struct spa_handle *handle)
|
static int impl_clear(struct spa_handle *handle)
|
||||||
|
|
@ -873,7 +873,7 @@ impl_init(const struct spa_handle_factory *factory,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
acp_set_log_func(impl_acp_log_func, this);
|
acp_set_log_func(impl_acp_log_func, this->log);
|
||||||
acp_set_log_level(6);
|
acp_set_log_level(6);
|
||||||
|
|
||||||
this->device.iface = SPA_INTERFACE_INIT(
|
this->device.iface = SPA_INTERFACE_INIT(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue