mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
warn about lock just once
This commit is contained in:
parent
80e063c6bc
commit
f42da492f9
4 changed files with 36 additions and 19 deletions
|
|
@ -87,6 +87,7 @@ struct globals {
|
|||
};
|
||||
|
||||
static struct globals globals;
|
||||
static bool mlock_warned = false;
|
||||
|
||||
#define OBJECT_CHUNK 8
|
||||
|
||||
|
|
@ -1801,11 +1802,14 @@ static int client_node_port_use_buffers(void *object,
|
|||
pw_log_warn("unknown buffer data type %d", d->type);
|
||||
}
|
||||
if (c->allow_mlock && mlock(d->data, d->maxsize) < 0) {
|
||||
pw_log_warn(NAME" %p: Failed to mlock memory %p %u: %s", c,
|
||||
if (errno != ENOMEM || !mlock_warned) {
|
||||
pw_log_warn(NAME" %p: Failed to mlock memory %p %u: %s", c,
|
||||
d->data, d->maxsize,
|
||||
errno == ENOMEM ?
|
||||
"This is not a problem but for best performance, "
|
||||
"consider increasing RLIMIT_MEMLOCK" : strerror(errno));
|
||||
mlock_warned |= errno == ENOMEM;
|
||||
}
|
||||
}
|
||||
}
|
||||
SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue