mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-09 23:50:15 -04:00
spa: alsa: pcm: log_write(): return early if log level is disabled
If the "debug" log level is not enabled for the "spa.alsa" log topic, then there is no point in going into the loop and splitting the data into lines, so skip that.
This commit is contained in:
parent
cfe9c7d6ca
commit
c8462edf4b
1 changed files with 3 additions and 0 deletions
|
|
@ -717,6 +717,9 @@ static ssize_t log_write(void *cookie, const char *buf, size_t size)
|
|||
{
|
||||
struct state *state = cookie;
|
||||
|
||||
if (!spa_log_level_topic_enabled(state->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_DEBUG))
|
||||
return size;
|
||||
|
||||
for (size_t left = size; left > 0; ) {
|
||||
const char *end = memchr(buf, '\n', left);
|
||||
size_t len = end ? end - buf : left;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue