mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: do the right log level checks
spa_log_level_enabled does not work when a custom log level has been set. Use spa_log_level_topic_enabled instead.
This commit is contained in:
parent
73073eb33f
commit
54b499b1cf
2 changed files with 4 additions and 4 deletions
|
|
@ -954,7 +954,7 @@ skip_channels:
|
||||||
|
|
||||||
static void debug_hw_params(struct state *state, const char *prefix, snd_pcm_hw_params_t *params)
|
static void debug_hw_params(struct state *state, const char *prefix, snd_pcm_hw_params_t *params)
|
||||||
{
|
{
|
||||||
if (SPA_UNLIKELY(spa_log_level_enabled(state->log, SPA_LOG_LEVEL_DEBUG))) {
|
if (SPA_UNLIKELY(spa_log_level_topic_enabled(state->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_DEBUG))) {
|
||||||
spa_log_debug(state->log, "%s:", prefix);
|
spa_log_debug(state->log, "%s:", prefix);
|
||||||
snd_pcm_hw_params_dump(params, state->output);
|
snd_pcm_hw_params_dump(params, state->output);
|
||||||
fflush(state->log_file);
|
fflush(state->log_file);
|
||||||
|
|
@ -1620,7 +1620,7 @@ static int set_swparams(struct state *state)
|
||||||
/* write the parameters to the playback device */
|
/* write the parameters to the playback device */
|
||||||
CHECK(snd_pcm_sw_params(hndl, params), "sw_params");
|
CHECK(snd_pcm_sw_params(hndl, params), "sw_params");
|
||||||
|
|
||||||
if (SPA_UNLIKELY(spa_log_level_enabled(state->log, SPA_LOG_LEVEL_DEBUG))) {
|
if (SPA_UNLIKELY(spa_log_level_topic_enabled(state->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_DEBUG))) {
|
||||||
spa_log_debug(state->log, "state after sw_params:");
|
spa_log_debug(state->log, "state after sw_params:");
|
||||||
snd_pcm_dump(hndl, state->output);
|
snd_pcm_dump(hndl, state->output);
|
||||||
fflush(state->log_file);
|
fflush(state->log_file);
|
||||||
|
|
@ -2413,7 +2413,7 @@ static void alsa_on_timeout_event(struct spa_source *source)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef FASTPATH
|
#ifndef FASTPATH
|
||||||
if (SPA_UNLIKELY(spa_log_level_enabled(state->log, SPA_LOG_LEVEL_TRACE))) {
|
if (SPA_UNLIKELY(spa_log_level_topic_enabled(state->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_TRACE))) {
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
uint64_t nsec;
|
uint64_t nsec;
|
||||||
if (spa_system_clock_gettime(state->data_system, CLOCK_MONOTONIC, &now) < 0)
|
if (spa_system_clock_gettime(state->data_system, CLOCK_MONOTONIC, &now) < 0)
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ static void init_ports(struct seq_state *state)
|
||||||
|
|
||||||
static void debug_event(struct seq_state *state, snd_seq_event_t *ev)
|
static void debug_event(struct seq_state *state, snd_seq_event_t *ev)
|
||||||
{
|
{
|
||||||
if (SPA_LIKELY(!spa_log_level_enabled(state->log, SPA_LOG_LEVEL_TRACE)))
|
if (SPA_LIKELY(!spa_log_level_topic_enabled(state->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_TRACE)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
spa_log_trace(state->log, "event type:%d flags:0x%x", ev->type, ev->flags);
|
spa_log_trace(state->log, "event type:%d flags:0x%x", ev->type, ev->flags);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue